

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/myblog/img/fluid.png">
  <link rel="icon" href="/myblog/img/fluid.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="joelee">
  <meta name="keywords" content="">
  
    <meta name="description" content="自从将 ubuntu 22.04 作为我的主力系统以来，就在实践中遇到的问题进行总结和解答。（供参考） 装系统后先做 删除 snap 查看 snap 安装的应用： 1snap list 卸载 snap 安装的应用程序（ snap_delete_app.sh ），直到 snap list 不返回任何软件： 123for p in $(snap list | awk &amp;#x27;&amp;#123;print">
<meta property="og:type" content="article">
<meta property="og:title" content="ubuntu主力系统日常记录">
<meta property="og:url" content="https://joelee-hit.github.io/joelee-hit.github.io/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/index.html">
<meta property="og:site_name" content="joelee&#39;s blog">
<meta property="og:description" content="自从将 ubuntu 22.04 作为我的主力系统以来，就在实践中遇到的问题进行总结和解答。（供参考） 装系统后先做 删除 snap 查看 snap 安装的应用： 1snap list 卸载 snap 安装的应用程序（ snap_delete_app.sh ），直到 snap list 不返回任何软件： 123for p in $(snap list | awk &amp;#x27;&amp;#123;print">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://joelee-hit.github.io/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/re-linuxcore-1.png">
<meta property="og:image" content="https://joelee-hit.github.io/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/image-20240316203317429.png">
<meta property="og:image" content="https://joelee-hit.github.io/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/image-20240309092748084.png">
<meta property="og:image" content="https://joelee-hit.github.io/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/image-20240309100436419.png">
<meta property="og:image" content="https://joelee-hit.github.io/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/image-20240309100535607.png">
<meta property="og:image" content="https://joelee-hit.github.io/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/9cd5cbe546614ed6a7627c3aa2a7c003.png">
<meta property="og:image" content="https://joelee-hit.github.io/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/sw-ve-kdenlive.jpg">
<meta property="og:image" content="https://joelee-hit.github.io/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/image-20231207213817907.png">
<meta property="og:image" content="https://joelee-hit.github.io/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/sw-zotero-pdftk.png">
<meta property="og:image" content="https://joelee-hit.github.io/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/sw-zotero-darkthemebug.png">
<meta property="og:image" content="https://joelee-hit.github.io/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/op-screen-1.png">
<meta property="og:image" content="https://joelee-hit.github.io/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/op-screen-2.png">
<meta property="og:image" content="https://joelee-hit.github.io/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/op-output-to-pdf.png">
<meta property="og:image" content="https://joelee-hit.github.io/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/op-rightclick-newfile.png">
<meta property="og:image" content="https://joelee-hit.github.io/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/bug-fcitx.png">
<meta property="og:image" content="https://joelee-hit.github.io/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/bug-internal-error.png">
<meta property="article:published_time" content="2024-01-06T16:10:30.000Z">
<meta property="article:modified_time" content="2024-05-14T12:53:05.270Z">
<meta property="article:author" content="joelee">
<meta property="article:tag" content="ubuntu">
<meta property="article:tag" content="主力系统">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://joelee-hit.github.io/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/re-linuxcore-1.png">
  
  
    <meta name="referrer" content="no-referrer-when-downgrade">
  
  
  <title>ubuntu主力系统日常记录 - joelee&#39;s blog</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/myblog/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/myblog/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/myblog/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"joelee-hit.github.io","root":"/myblog/","version":"1.9.5-a","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":true,"follow_dnt":true,"baidu":null,"google":{"measurement_id":null},"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":"UU4TJ0JQzDgf0er5h2RfW8ve-gzGzoHsz","app_key":"px4eIsDZQBJRxIUkt6PCJpNH","server_url":"https://uu4tj0jq.lc-cn-n1-shared.com","path":"window.location.pathname","ignore_local":true}},"search_path":"/myblog/local-search.xml","include_content_in_search":true};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/myblog/js/utils.js" ></script>
  <script  src="/myblog/js/color-schema.js" ></script>
  

  

  
    <!-- Google tag (gtag.js) -->
    <script async>
      if (!Fluid.ctx.dnt) {
        Fluid.utils.createScript("https://www.googletagmanager.com/gtag/js?id=", function() {
          window.dataLayer = window.dataLayer || [];
          function gtag() {
            dataLayer.push(arguments);
          }
          gtag('js', new Date());
          gtag('config', '');
        });
      }
    </script>
  

  

  

  

  
    
  



  
<meta name="generator" content="Hexo 6.3.0"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/myblog/">
      <strong>joelee的记事本</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/myblog/">
                <i class="iconfont icon-home-fill"></i>
                <span>首页</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/myblog/archives/">
                <i class="iconfont icon-archive-fill"></i>
                <span>归档</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/myblog/categories/">
                <i class="iconfont icon-category-fill"></i>
                <span>分类</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/myblog/tags/">
                <i class="iconfont icon-tags-fill"></i>
                <span>标签</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/myblog/about/">
                <i class="iconfont icon-user-fill"></i>
                <span>关于</span>
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              <i class="iconfont icon-search"></i>
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
              <i class="iconfont icon-dark" id="color-toggle-icon"></i>
            </a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/myblog/img/default.png') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="ubuntu主力系统日常记录"></span>
          
        </div>

        
          
  <div class="mt-3">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-author" aria-hidden="true"></i>
        joelee
      </span>
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2024-01-07 00:10" pubdate>
          2024年1月7日 凌晨
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          48k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          402 分钟
        
      </span>
    

    
    
      
        <span id="busuanzi_container_page_pv" style="display: none">
          <i class="iconfont icon-eye" aria-hidden="true"></i>
          <span id="busuanzi_value_page_pv"></span> 次
        </span>
        
      
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <h1 id="seo-header">ubuntu主力系统日常记录</h1>
            
              <p class="note note-info">
                
                  
                    本文最后更新于：2024年5月14日 晚上
                  
                
              </p>
            
            
              <div class="markdown-body">
                
                <p>自从将 ubuntu 22.04
作为我的主力系统以来，就在实践中遇到的问题进行总结和解答。（供参考）</p>
<h1 id="装系统后先做">装系统后先做</h1>
<h2 id="删除-snap">删除 snap</h2>
<p>查看 snap 安装的应用：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">snap list<br></code></pre></td></tr></table></figure>
<p>卸载 snap 安装的应用程序（ snap_delete_app.sh ），直到
<code>snap list</code> 不返回任何软件：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-keyword">for</span> p <span class="hljs-keyword">in</span> $(snap list | awk <span class="hljs-string">&#x27;&#123;print $1&#125;&#x27;</span>); <span class="hljs-keyword">do</span><br>	sudo snap remove --purge <span class="hljs-variable">$p</span><br><span class="hljs-keyword">done</span><br></code></pre></td></tr></table></figure>
<p>删除 snap 的内核（ snap_delete_core.sh ）：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo systemctl stop snapd<br>sudo systemctl <span class="hljs-built_in">disable</span> --now snapd.socket<br>sudo systemctl <span class="hljs-built_in">disable</span> --now snapd.service<br>sudo systemctl <span class="hljs-built_in">disable</span> --now snapd.seeded.service<br><br><span class="hljs-keyword">for</span> m <span class="hljs-keyword">in</span> /snap/core/*; <span class="hljs-keyword">do</span><br>	sudo umount <span class="hljs-variable">$m</span><br><span class="hljs-keyword">done</span><br></code></pre></td></tr></table></figure>
<p>卸载 snap ：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt autoremove --purge snapd<br></code></pre></td></tr></table></figure>
<p>删除 snap 残留的文件（若有， snap_delete_dir.sh ）：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">rm</span> -rf ~/snap<br>sudo <span class="hljs-built_in">rm</span> -rf /snap<br>sudo <span class="hljs-built_in">rm</span> -rf /var/snap<br>sudo <span class="hljs-built_in">rm</span> -rf /var/lib/snapd<br>sudo <span class="hljs-built_in">rm</span> -rf /var/cache/snapd<br></code></pre></td></tr></table></figure>
<p>禁止 apt 搜索和下载 snapd 和 firefox ：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ sudo sh -c <span class="hljs-string">&quot;cat &gt; /etc/apt/preferences.d/no-snapd.pref&quot;</span> &lt;&lt; <span class="hljs-string">EOL</span><br><span class="hljs-string">Package: snapd</span><br><span class="hljs-string">Pin: release a=*</span><br><span class="hljs-string">Pin-Priority: -10</span><br><span class="hljs-string">EOL</span><br><br><span class="hljs-comment"># 可以通过 sudo apt search/install snapd 来验证</span><br><br>$ sudo sh -c <span class="hljs-string">&quot;cat &gt; /etc/apt/preferences.d/no-firefox.pref&quot;</span> &lt;&lt; <span class="hljs-string">EOL</span><br><span class="hljs-string">Package: firefox</span><br><span class="hljs-string">Pin: release a=*</span><br><span class="hljs-string">Pin-Priority: -10</span><br><span class="hljs-string">EOL</span><br></code></pre></td></tr></table></figure>
<h2 id="apt-换源-更新">apt 换源 &amp; 更新</h2>
<p>可以在 <code>Software &amp; Updates</code> 里面将镜像源更改成
<code>mirrors.bfsu.edu.cn</code> （北外源）。然后
<code>sudo apt update &amp;&amp; sudo apt upgrade</code> 。</p>
<h3 id="apt-禁止更新某软件-apt-mark">apt 禁止更新某软件 (apt-mark)</h3>
<p>可以使用 <code>apt-mark</code> ，以 <code>openvpn</code> 为例：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt-mark hold openvpn<br><span class="hljs-comment"># sudo apt-mark hold libssl1.1</span><br><br>sudo apt-mark showhold  <br><span class="hljs-comment"># 列出 apt-mark 的所有软件</span><br></code></pre></td></tr></table></figure>
<h3 id="清除-apt-缓存">清除 apt 缓存</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt autoremove --purge<br>sudo apt autoclean<br>sudo apt clean<br></code></pre></td></tr></table></figure>
<h2 id="固定内核版本">固定内核版本</h2>
<p>内核的更新会给某些软件带来不必要的麻烦，例如
<code>vmware workstation</code> 。所以我们需要固定内核版本。</p>
<p>查看内核版本：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">dpkg --get-selections | grep linux<br></code></pre></td></tr></table></figure>
<img src="/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/re-linuxcore-1.png" srcset="/myblog/img/loading.gif" lazyload class="" title="image-20240107005910491">
<p>卸载内核：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt remove --purge linux-headers-6.2.0-39-generic linux-hwe-6.2-headers-6.2.0-39 linux-image-6.2.0-39-generic linux-modules-6.2.0-39-generic linux-modules-extra-6.2.0-39-generic<br><br><span class="hljs-comment"># 一行代码, 批量卸载</span><br>dpkg --get-selections | grep 6.2.0-35 | awk <span class="hljs-string">&#x27;&#123;print $1&#125;&#x27;</span> | xargs sudo apt remove --purge -y<br><br><span class="hljs-comment"># 检查一遍</span><br>dpkg --get-selections | grep linux<br></code></pre></td></tr></table></figure>
<p>接下来我们还需要<strong>更新系统引导</strong>（更新 grup
，移除失效的启动项）：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo update-grub　　<span class="hljs-comment"># 根据情况选择grub/grub2</span><br></code></pre></td></tr></table></figure>
<p>禁止 apt 更新内核：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ sudo vi /etc/apt/apt.conf.d/10periodic<br><span class="hljs-comment"># 改成</span><br>APT::Periodic::Update-Package-Lists <span class="hljs-string">&quot;0&quot;</span>;<br>APT::Periodic::Download-Upgradeable-Packages <span class="hljs-string">&quot;0&quot;</span>;<br>APT::Periodic::AutocleanInterval <span class="hljs-string">&quot;0&quot;</span>;<br>APT::Periodic::Unattended-Upgrade <span class="hljs-string">&quot;0&quot;</span>;<br><br>$ sudo vi /etc/apt/apt.conf.d/20auto-upgrades<br><span class="hljs-comment"># 改成</span><br>APT::Periodic::Update-Package-Lists <span class="hljs-string">&quot;0&quot;</span>;<br>APT::Periodic::Download-Upgradeable-Packages <span class="hljs-string">&quot;0&quot;</span>;<br>APT::Periodic::AutocleanInterval <span class="hljs-string">&quot;0&quot;</span>;<br>APT::Periodic::Unattended-Upgrade <span class="hljs-string">&quot;0&quot;</span>;<br><br><br>$ sudo apt-mark hold linux-headers-6.2.0-39-generic linux-hwe-6.2-headers-6.2.0-39 linux-image-6.2.0-39-generic linux-modules-6.2.0-39-generic linux-modules-extra-6.2.0-39-generic<br></code></pre></td></tr></table></figure>
<p>但是在后续实践中，发现 <code>apt-mark</code>
禁止升级的内核相应包并没有如愿被禁止更新，应该还需加上</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt-mark hold linux-generic-hwe-22.04 linux-headers-generic-hwe-22.04 linux-image-generic-hwe-22.04<br></code></pre></td></tr></table></figure>
<h2 id="优化">优化</h2>
<h3 id="preload">preload</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt install preload<br></code></pre></td></tr></table></figure>
<h3 id="tlp">tlp</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo add-apt-repository ppa:linrunner/tlp<br>sudo apt update<br>sudo apt install tlp tlp-rdw  <span class="hljs-comment"># 1236kb</span><br><span class="hljs-comment"># https://ppa.launchpadcontent.net/linrunner/tlp/ubuntu/pool/main/t/tlp/</span><br><br><span class="hljs-comment"># 启动</span><br>sudo tlp start<br><span class="hljs-comment"># 或 systemctl start tlp.service</span><br><br><span class="hljs-comment"># 用法</span><br>sudo tlp-stat -b  <span class="hljs-comment"># battery</span><br>sudo tlp-stat -d  <span class="hljs-comment"># disk</span><br>sudo tlp-stat -e  <span class="hljs-comment"># pcie PCI device</span><br>sudo tlp-stat -g  <span class="hljs-comment"># graphics</span><br>sudo tlp-stat -p  <span class="hljs-comment"># processor</span><br>sudo tlp-stat -s  <span class="hljs-comment"># system</span><br>sudo tlp-stat -t  <span class="hljs-comment"># temperature &amp; fan</span><br>sudo tlp-stat -u  <span class="hljs-comment"># USB</span><br>sudo tlp-stat -w  <span class="hljs-comment"># warning</span><br>sudo tlp-stat  <span class="hljs-comment"># all status</span><br></code></pre></td></tr></table></figure>
<h3 id="加速-ppa">加速 ppa</h3>
<p>每个ppa都会在<code>/etc/apt/sources.list.d</code>
目录下创建一个list文件。</p>
<p>只需要将其中的<a
target="_blank" rel="noopener" href="https://ppa.launchpad.net/">https://ppa.launchpad.net</a> 或
https://ppa.launchpadcontent.net替换为<a
target="_blank" rel="noopener" href="https://launchpad.proxy.ustclug.org/">https://launchpad.proxy.ustclug.org</a>就行。</p>
<p>以 <code>tlp</code> 为例：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ vi /etc/apt/sources.list.d/linrunner-ubuntu-tlp-jammy.list<br><span class="hljs-comment"># deb https://ppa.launchpad.net/linrunner/tlp/ubuntu/ jammy main </span><br><span class="hljs-comment"># 改成 </span><br><span class="hljs-comment"># deb https://launchpad.proxy.ustclug.org/linrunner/tlp/ubuntu/ jammy main</span><br></code></pre></td></tr></table></figure>
<h3 id="移除-apt-update-时语言相关的-ign">移除 apt update 时语言相关的
ign</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ sudo vi /etc/apt/apt.conf.d/00aptitude<br><span class="hljs-comment"># 末尾加上</span><br><span class="hljs-comment"># Acquire::Languages &quot;none&quot;;</span><br></code></pre></td></tr></table></figure>
<h3 id="bleachbit">bleachbit</h3>
<p>清除垃圾的工具。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt install bleachbit<br></code></pre></td></tr></table></figure>
<h3 id="解决关机时-a-stop-job-问题改为手动更新">解决关机时 a stop job
问题（改为手动更新）</h3>
<p>问题：重启发现用时过长，显示：<code>A stop job is running for Unattended Upgrades Shutdown (10s / 1min30s)</code>
。</p>
<hr />
<p>关闭无监督自动更新，发现是Ubuntu会自动更新，但这时间也太长了，于是果断禁用。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo dpkg-reconfigure unattended-upgrades<br><span class="hljs-comment"># 选择no</span><br><br>sudo apt autoremove --purge unattended-upgrades<br><span class="hljs-comment"># 完全删除</span><br></code></pre></td></tr></table></figure>
<p>它不会删除你的Ubuntu系统上的其他软件，因此可以安全地删除无人参与的升级包。</p>
<p>从现在开始，你的Ubuntu系统不会自动下载和安装重要的更新，你必须使用命令一次手动下载和安装更新。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt update &amp;&amp; sudo apt upgrade<br></code></pre></td></tr></table></figure>
<p>转载自 https://www.jianshu.com/p/57111d63a838</p>
<hr />
<p>设置等待的时间，编辑 <code>/etc/systemd/system.conf</code> ，把
<code>#DefaultTimeoutStopSec=90s</code> 先去掉
<code>#</code>，然后改成想要的时间，如5s，即
<code>DefaultTimeoutStopSec=5s</code>，保存退出。然后重新加载服务的配置文件，<code>sudo systemctl daemon-reload</code>
。</p>
<h3 id="解决-apt-的-doesnt-support-i386">解决 apt 的 doesn't support
'i386'</h3>
<p>在相应软件的 <code>.list</code> 文件里添加 <code>[arch=amd64]</code>
即可。以 node18.0 为例，</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-comment"># 加上 [arch=amd64] 即可</span><br>$ sudo vi /etc/apt/sources.list.d/nodesource.list<br><br><span class="hljs-comment"># deb [arch=amd64 signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main</span><br></code></pre></td></tr></table></figure>
<h3 id="安装-apt-fast">安装 apt-fast</h3>
<p>转载自 https://www.sysgeek.cn/ubuntu-apt-fast/</p>
<h1 id="常用软件">常用软件</h1>
<h2 id="学习">学习</h2>
<h3 id="每日英语听力">每日英语听力</h3>
<p>缓存目录：<code>/home/joelee/.config/ting_en</code></p>
<h4 id="crack">crack</h4>
<p>https://www.52pojie.cn/thread-1869531-1-1.html</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo npm install -g @electron/asar<br>sudo npm uninstall -g asar<br><span class="hljs-built_in">cd</span> /opt/每日英语听力/resources<br>sudo asar extract app.asar ./tmp<br><span class="hljs-built_in">cd</span> tmp<br>sudo vi dist/electron/renderer.js  <span class="hljs-comment"># /save(), n下一个,N上一个</span><br><span class="hljs-comment"># 搜索save(),在第三个后面加上this.ting.istingvip = true,this.ting.tingvipendtime = &quot;2099-10-31T12:34:56Z&quot;,this.ting.tingviptype = &quot;multiyearvip&quot;;</span><br><span class="hljs-comment"># 变成save()&#123;this._store.set(&quot;login&quot;,&#123;user:this.user,ting:this.ting&#125;,this.ting.istingvip = true,this.ting.tingvipendtime=&quot;2099-10-31T12:34:56Z&quot;,this.ting.tingviptype=&quot;multiyearvip&quot;)&#125;</span><br>sudo asar pack ./ app.asar<br>killall ting_en<br>sudo <span class="hljs-built_in">mv</span> /opt/每日英语听力/resources/app.asar /opt/每日英语听力/resources/tmp/app.asar.bak<br>sudo <span class="hljs-built_in">mv</span> ./app.asar ../ <br></code></pre></td></tr></table></figure>
<img src="/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/image-20240316203317429.png" srcset="/myblog/img/loading.gif" lazyload class="" title="image-20240316203317429">
<h3 id="goldendict">goldendict</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt-fast install goldendict<br><span class="hljs-comment"># 60MB</span><br><span class="hljs-comment"># goldendict libeb16 libqt5help5 libqt5multimedia5-plugins libqt5multimediagsttools5 libqt5multimediawidgets5 libqt5sensors5 libqt5webkit5</span><br></code></pre></td></tr></table></figure>
<p>缓存目录：<code>~/.goldendict</code></p>
<p>教程：https://blog.csdn.net/weixin_56463218/article/details/132645984</p>
<blockquote>
<p>https://sspai.com/post/85225#!</p>
<p>https://www.cnblogs.com/keatonlao/p/12702571.html</p>
</blockquote>
<h2 id="编程">编程</h2>
<h3 id="fastgithub">fastgithub</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">Updating certificates <span class="hljs-keyword">in</span> /etc/ssl/certs...<br>0 added, 0 removed; <span class="hljs-keyword">done</span>.<br>Running hooks <span class="hljs-keyword">in</span> /etc/ca-certificates/update.d...<br></code></pre></td></tr></table></figure>
<h3 id="codeblocks">codeblocks</h3>
<p><a target="_blank" rel="noopener" href="https://www.codeblocks.org/">官网</a> Code::Blocks is a free
C/C++ and Fortran IDE built to meet the most demanding needs of its
users. It is designed to be very extensible and fully configurable.</p>
<p>（1）<a
target="_blank" rel="noopener" href="https://www.codeblocks.org/downloads/binaries/#imagesoslinux48pnglogo-linux-32-and-64-bit">下载linux64安装包
.tar.xz</a></p>
<p>（2）通过发行版的包管理器</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt install codeblocks<br><span class="hljs-comment"># codeblocks codeblocks-common libastyle3 libcodeblocks0 libutempter0 xterm 23.8 MB</span><br>sudo apt install codeblocks-contrib<br><span class="hljs-comment"># codeblocks-contrib libwxsmithlib0 valgrind 100MB</span><br></code></pre></td></tr></table></figure>
<h4 id="配置代码区主题">配置代码区主题</h4>
<p>主题文件位于
<code>/home/joelee/.config/codeblocks/default.conf</code> 。</p>
<h4 id="ui主题">UI主题</h4>
<p>由于我的系统使用dark的主题，所以cb也会变成dark主题，但是cb的dark主题非常的难看，还不如全白，所以只需将cb的启动器文件中的<code>Exec</code>项改成
<code>Exec=env GTK_THEME=Pop-light codeblocks %F</code> 。效果如下：</p>
<img src="/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/image-20240309092748084.png" srcset="/myblog/img/loading.gif" lazyload class="" title="image-20240309092748084">
<h4 id="更改终端">更改终端</h4>
<p>xterm终端太丑了，且不能对其文本进行操作。</p>
<p><code>settings - Environment - General Settings - Terminal to launch console programs</code>
，选择<code>gnome-terminal -t $TITLE x</code> 。更详细的命令：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">gnome-terminal --geometry 80x20+100+100 --hide-menubar -t <span class="hljs-variable">$TITLE</span> -x <br></code></pre></td></tr></table></figure>
<h4 id="代码补全">代码补全</h4>
<p><code>Settings - Editor - General Settings</code>：有个代码补全的设置的区域，</p>
<img src="/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/image-20240309100436419.png" srcset="/myblog/img/loading.gif" lazyload class="" title="image-20240309100436419">
<p>另外，切换到<code>Code Completion</code>界面，设置</p>
<img src="/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/image-20240309100535607.png" srcset="/myblog/img/loading.gif" lazyload class="" title="image-20240309100535607">
<h4 id="行号宽度">行号宽度</h4>
<p><code>Setting-&gt;Editor-&gt;Margins and caret</code> ，修改width for
line numbers，选中dynamic setting 即可。</p>
<p>修改光标的形状，颜色，宽度：直接修改Caret中的属性即可，光标颜色选择白色。</p>
<p>设置了行号宽度感觉好看多了，但是编辑器左边白一块，和编辑器的暗黑背景不搭配啊，还可以继续优化
选择
Settings-&gt;Environment-&gt;Colours，Category下拉列表选择Editor（英语好一点的人都知道我在干什么）
修改如下标注的属性，Line numbers foreground
color（这是行号数字的颜色，随便改），其余全部改为和编辑器一样的暗黑色，（R：40，G：50，B：40）
点击ok，大功告成！</p>
<h4 id="禁用spellcheck插件">禁用spellcheck插件</h4>
<p>解决方法：禁用 SpellChecker 插件，选择plugins，弹出下拉框，再选择
最后一个manage plugins，找到Spell Checker 选中再点击
Disable，就可以了。</p>
<img src="/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/9cd5cbe546614ed6a7627c3aa2a7c003.png" srcset="/myblog/img/loading.gif" lazyload class="" title="img">
<h4 id="自动换行">自动换行</h4>
<p>settings-&gt;other editor settings-&gt;word wrap打勾</p>
<h4
id="sqrt在main.c中成功编译在其他函数里使用不通过">sqrt在main.c中成功编译,在其他函数里使用不通过</h4>
<p>这是一个很sb的问题，亏我搞了这么久，<a
target="_blank" rel="noopener" href="https://blog.csdn.net/csdnliwenqi/article/details/105992628">参考链接</a></p>
<p>打开
<code>Settings</code>-<code>Compiler</code>-<code>linker setting</code>-<code>other link option</code>
，加上<code>-lm</code>选项即可。</p>
<h3 id="rstudio">Rstudio</h3>
<p><a target="_blank" rel="noopener" href="https://posit.co/download/rstudio-desktop/">官网</a> <a
target="_blank" rel="noopener" href="https://cran.rstudio.com/">R官网</a> <a
target="_blank" rel="noopener" href="https://computingforgeeks.com/how-to-install-r-and-rstudio-on-ubuntu-debian-mint">民间教程</a></p>
<p>Rstudio是R语言的IDE，首先需要先安装R语言，</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt install r-base<br><span class="hljs-comment"># bzip2-doc gfortran gfortran-11 icu-devtools libblas-dev libbz2-dev libgfortran-11-dev libicu-dev libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev liblapack-dev liblzma-dev libncurses-dev libncurses5-dev libpcre16-3 libpcre2-dev libpcre2-posix3 libpcre3-dev libpcre32-3 libpcrecpp0v5 libreadline-dev r-base r-base-core r-base-dev r-base-html r-cran-boot r-cran-class r-cran-cluster r-cran-codetools r-cran-foreign r-cran-kernsmooth r-cran-lattice r-cran-mass r-cran-matrix r-cran-mgcv r-cran-nlme r-cran-nnet r-cran-rpart r-cran-spatial r-cran-survival r-doc-html r-recommended</span><br></code></pre></td></tr></table></figure>
<p>共需要安装43个包，总共194MB。</p>
<p>安装Rstudio，</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">wget https://download1.rstudio.org/electron/jammy/amd64/rstudio-2023.12.1-402-amd64.deb<br>sudo apt install ./rstudio-2023.12.1-402-amd64.deb<br><span class="hljs-comment"># lib32gcc-s1 lib32stdc++6 libc6-i386 libclang-14-dev libclang-common-14-dev libclang-dev libclang1-14 libllvm14 libobjc-11-dev libssl-dev rstudio</span><br></code></pre></td></tr></table></figure>
<p>共需要安装11个包，总共1176MB。</p>
<blockquote>
<p><a
target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_39811386/article/details/116890479">参考</a>
更改默认工作目录：Rstudio - Tool - Global Options - General
，验证：<code>getwd()</code></p>
<p>更改依赖包安装目录：<code>file.edit('~/.Rprofile')</code>，里面输入</p>
<figure class="highlight tex"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs tex">.libPaths(c(&quot;/home/joelee/App/Coder/R/Rpackages/4.1&quot;, &quot;/home/joelee/R/x86<span class="hljs-built_in">_</span>64-pc-linux-gnu-library/4.1&quot;))<br></code></pre></td></tr></table></figure>
<p>验证：<code>./libPaths()</code></p>
<p>更换源：Rstudio-Tools-Options-Packages-Choose Primary
Repository，更换为清华源 ，</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs bash">options(<span class="hljs-string">&quot;repos&quot;</span> = c(CRAN=<span class="hljs-string">&quot;https://mirrors.tuna.tsinghua.edu.cn/CRAN/&quot;</span>))<br>options()<span class="hljs-variable">$repos</span>  <span class="hljs-comment"># 查看使用install.packages安装时的默认镜像</span><br>options()<span class="hljs-variable">$BioC_mirror</span> <span class="hljs-comment"># 查看使用bioconductor的默认镜像</span><br>options(BioC_mirror=<span class="hljs-string">&quot;https://mirrors.ustc.edu.cn/bioc/&quot;</span>) <span class="hljs-comment"># 指定镜像，这个是中国科技大学镜像</span><br></code></pre></td></tr></table></figure>
</blockquote>
<h3 id="vscode">vscode</h3>
<h4 id="去除窗口标题栏">去除窗口标题栏</h4>
<p>ctrl+shift+p，呼出搜索栏，输入<code>settings</code>
，打开<code>Settings(UI)</code>，再搜索<code>window.titleBarStyle</code>，将该项改为“custom”。</p>
<h3 id="nodejs">nodejs</h3>
<h4 id="npm清理缓存">npm清理缓存</h4>
<p>缓存位置：<code>npm config get cache</code>=<code>~/.npm</code>
清理命令：<code>npm cache clean --force</code>
用户配置位置：<code>/home/joelee/.npmrc</code></p>
<p>全局安装位置：<code>npm config get prefix</code> = <code>/usr</code>
或者 <code>npm root -g</code> = <code>/usr/lib/node_modules</code></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs bash">1、设置npm安装的地址<br>npm config <span class="hljs-built_in">set</span> prefix <span class="hljs-string">&quot;&quot;</span><br><br>2、npm缓存位置设置<br>npm config <span class="hljs-built_in">set</span> cache <span class="hljs-string">&quot;&quot;</span><br></code></pre></td></tr></table></figure>
<h3 id="dosbox">dosbox</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-comment"># x86 emulator with Tandy/Herc/CGA/EGA/VGA/SVGA graphics, sound and DOS</span><br>sudo apt-fast install dosbox<br><span class="hljs-comment"># 3,360 kB dosbox libmikmod3 libsdl-net1.2 libsdl-sound1.2</span><br><br><span class="hljs-comment"># and dosbox-debug  &#x27;x86 emulator with DOS - debugger&#x27;</span><br><br></code></pre></td></tr></table></figure>
<h2 id="视频剪辑">视频剪辑</h2>
<h3 id="kdenlive">kdenlive</h3>
<p>免费且开源的视频编辑器，官网链接：<a
target="_blank" rel="noopener" href="https://kdenlive.org/en/download/">kdenlive</a></p>
<img src="/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/sw-ve-kdenlive.jpg" srcset="/myblog/img/loading.gif" lazyload class="" title="undefined">
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-comment"># 占用 578 MB 空间</span><br>sudo add-apt-repository ppa:kdenlive/kdenlive-stable<br>sudo apt-fast update<br>sudo apt-fast install kdenlive<br></code></pre></td></tr></table></figure>
<h2 id="社交">社交</h2>
<h3 id="微信">微信</h3>
<p>微信已经出了 linux 版，截止23年1月的最新版本是
2.1.9，推荐使用<code>星火应用商店</code>。</p>
<blockquote>
<p>星火应用商店（GUI）：https://spark-app.store/download</p>
<p>星火应用商店（Console）：https://gitee.com/spark-store-project/spark-store</p>
</blockquote>
<p>在应用终端依次执行：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ spark-store-console<br><span class="hljs-comment"># 选择&#x27;社交沟通&#x27;, 再选择&#x27;微信Linux&#x27;, </span><br>标题：微信Linux<br>版本：2.1.9<br>包名：store.spark-app.wechat-linux-spark<br>作者：懵仙兔兔 &lt;acgm@qq.com&gt;<br>投稿者:shenmo &lt;jifengshenmo@outlook.com&gt;<br>官网：https://wx.qq.com/<br>大小：87.78 MB<br>更新时间：2023-11-17 20:17:51<br>介绍：<br>微信 <span class="hljs-keyword">for</span> Linux<br>支持了语音通话<br><br><span class="hljs-comment"># 选择&#x27;install&#x27;</span><br></code></pre></td></tr></table></figure>
<p>存储目录：<code>/home/joelee/.config/weixin/wechat</code></p>
<h4 id="wechat-beta">wechat-beta</h4>
<p><a target="_blank" rel="noopener" href="https://www.52pojie.cn/thread-1896902-1-1.html">1.0.0.150
介绍链接</a> 数据存储目录是 <code>/home/joelee/.xwechat</code>
。启动文件是 <code>/usr/share/applications/wechat.desktop</code>
。程序文件位于 <code>/usr/bin/wechat</code> 。</p>
<p>[无法卸载]: 编辑 <code>/var/lib/dpkg/info/wechat-beta.postrm</code>
，在最后一行加上 <code>fi</code> 。</p>
<h3 id="yesplaymusic">YesPlayMusic</h3>
<p>https://github.com/qier222/YesPlayMusic</p>
<h2 id="工具">工具</h2>
<h3 id="obs">OBS</h3>
<p>官网：https://obsproject.com/</p>
<p>安装步骤：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo add-apt-repository ppa:obsproject/obs-studio<br>sudo apt update<br>sudo apt install ffmpeg obs-studio <span class="hljs-comment"># obs-studio:351MB</span><br>sudo apt autoremove --purge ffmpeg obs-studio <span class="hljs-comment"># 427MB</span><br></code></pre></td></tr></table></figure>
<h3 id="todesk">Todesk</h3>
<p><a target="_blank" rel="noopener" href="https://www.todesk.com/download.html">ToDesk官网</a>
：log日志目录有<code>~/.local/share/todesk/Logs</code>、<code>/var/log/todesk</code>。</p>
<h3 id="easyconnect-hit-version">EasyConnect (HIT version)</h3>
<blockquote>
<p><a target="_blank" rel="noopener" href="http://static.hit.edu.cn/vpn/#">哈工大版本</a></p>
<p><a
target="_blank" rel="noopener" href="http://download.sangfor.com.cn/download/product/sslvpn/pkg/linux_767/EasyConnect_x64_7_6_7_3.deb">通用版本</a>：在<a
target="_blank" rel="noopener" href="https://vpn2.shu.edu.cn/portal/#!/login">Easy
Connect官网</a>上下载<a
target="_blank" rel="noopener" href="http://download.sangfor.com.cn/download/product/sslvpn/pkg/linux_767/EasyConnect_x64_7_6_7_3.deb">EasyConnect_x64
For Ubuntu</a>版本</p>
<p>注意：无法跳转下载时请按F12打开浏览器控制台，点击<code>NetWork</code>Tab，查看刚刚发送的请求，可以看到<code>Request URL</code>就是该文件的直链，复制到浏览器下载即可。</p>
</blockquote>
<p>安装：<code>sudo apt install ./EasyConnect_x64_7_6_7_3.deb</code></p>
<h4 id="点击图标无法打开">点击图标无法打开</h4>
<p>系统日志：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo dmesg<br><span class="hljs-comment"># [28131.184455] process &#x27;share/sangfor/EasyConnect/EasyConnect&#x27; started with executable stack</span><br><span class="hljs-comment"># [28131.451640] show_signal: 14 callbacks suppressed</span><br><span class="hljs-comment"># [28131.451643] traps: EasyConnect[56116] general protection fault ip:7f41a1f57b09 sp:7ffc022a2370 error:0 in libharfbuzz.so.0.20704.0[7f41a1f3a000+91000]</span><br><span class="hljs-comment"># [28139.682435] traps: EasyConnect[56154] general protection fault ip:7f4c2b957b09 sp:7fffcdcfd5f0 error:0 in libharfbuzz.so.0.20704.0[7f4c2b93a000+91000]</span><br><span class="hljs-comment"># [28380.020273] traps: EasyConnect[56966] general protection fault ip:7f9d83670b09 sp:7fffa54691e0 error:0 in libharfbuzz.so.0.20704.0[7f9d83653000+91000]</span><br></code></pre></td></tr></table></figure>
<p>查阅<a
target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/648655420">资料</a>发现原因就是
libpango 这个包在 Ubuntu 22.04
系统里的版本太高了，需要进行降版本处理。为了防止修改系统库带来的风险，直接将相关的
.so 库文件解压到 easyconnect 同目录下即可，即
<code>/usr/share/sangfor/EasyConnect/</code> 下。</p>
<blockquote>
<p><a
target="_blank" rel="noopener" href="http://kr.archive.ubuntu.com/ubuntu/pool/main/p/pango1.0/">低版本
libpango地址</a> ，在该地址里找到以下三个文件：</p>
<p><a
target="_blank" rel="noopener" href="http://kr.archive.ubuntu.com/ubuntu/pool/main/p/pango1.0/libpangocairo-1.0-0_1.40.14-1_amd64.deb">libpangocairo-1.0-0_1.40.14-1_amd64.deb</a></p>
<p><a
target="_blank" rel="noopener" href="http://kr.archive.ubuntu.com/ubuntu/pool/main/p/pango1.0/libpangoft2-1.0-0_1.40.14-1_amd64.deb">libpangoft2-1.0-0_1.40.14-1_amd64.deb</a></p>
<p><a
target="_blank" rel="noopener" href="http://kr.archive.ubuntu.com/ubuntu/pool/main/p/pango1.0/libpango-1.0-0_1.40.14-1_amd64.deb">libpango-1.0-0_1.40.14-1_amd64.deb</a></p>
<p>解压下载下来的三个 deb 包，并获取每个 deb 包中
<code>xxx.deb/data.tar.xz/usr/lib/x86_64-linux-gnu</code>
下的所有内容，集合在一起如下：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs bash">libpango-1.0.so.0  <br>libpango-1.0.so.0.4000.14  <br>libpangocairo-1.0.so.0  <br>libpangocairo-1.0.so.0.4000.14  <br>libpangoft2-1.0.so.0  <br>libpangoft2-1.0.so.0.4000.14<br></code></pre></td></tr></table></figure>
<p>拷贝到 <code>/usr/share/sangfor/EasyConnect/</code>
，命令行或者点击图标打开EasyConnect。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">/usr/share/sangfor/EasyConnect/EasyConnect --enable-transparent-visuals --disable-gpu<br></code></pre></td></tr></table></figure>
<p>连接成功后，在右上角可以看到图标（不显示灰色）。</p>
</blockquote>
<h4 id="hit-vpn服务器地址">HIT vpn服务器地址</h4>
<p>https://vpn.hitsz.edu.cn 或 https://ivpn.hit.edu.cn</p>
<h3 id="vlc-player">VLC Player</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt install vlc<br></code></pre></td></tr></table></figure>
<h3 id="爱思助手管理ios">爱思助手(管理ios)</h3>
<p><a target="_blank" rel="noopener" href="https://www.i4.cn/pro_pc.html">爱思助手官网</a></p>
<p><a
target="_blank" rel="noopener" href="https://d-updater.i4.cn/i4linux/deb/i4tools_v1.0.055.deb">i4tools_v1.0.055.deb</a></p>
<p>缺失的库文件：</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs yaml"><span class="hljs-string">libldap_r-2.4.so.2</span>  <span class="hljs-string">libldap_r-2.4.so.2.10.9</span><br><span class="hljs-string">liblber-2.4.so.2</span>    <span class="hljs-string">liblber-2.4.so.2.10.9</span><br><span class="hljs-string">libwebp.so.6</span>        <span class="hljs-string">libwebp.so.6.0.2</span><br><span class="hljs-string">libsasl2.so.3</span>       <span class="hljs-string">libsasl2.so.3.0.0</span><br></code></pre></td></tr></table></figure>
<h3 id="peekgif">peek(gif)</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo add-apt-repository ppa:peek-developers/stable<br>sudo apt-fast update &amp;&amp; sudo apt-fast upgrade <br>sudo apt-fast install peek <br><span class="hljs-comment"># gstreamer1.0-plugins-ugly libkeybinder-3.0-0 libsidplay1v5 peek</span><br><span class="hljs-comment"># 2,194 kB</span><br></code></pre></td></tr></table></figure>
<h3 id="便条-stckynotes">便条 stckynotes</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt-add-repository ppa:umang/indicator-stickynotes<br>sudo apt-get update &amp;&amp; sudo apt-get install indicator-stickynotes<br><span class="hljs-comment"># gir1.2-appindicator3-0.1 gir1.2-gtksource-3.0 indicator-stickynotes libgtksourceview-3.0-1 libgtksourceview-3.0-common</span><br><span class="hljs-comment"># 3,676 kB</span><br></code></pre></td></tr></table></figure>
<ol type="1">
<li>第一句实际进行的操作：</li>
</ol>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">Adding deb entry to /etc/apt/sources.list.d/umang-ubuntu-indicator-stickynotes-jammy.list<br>Adding disabled deb-src entry to /etc/apt/sources.list.d/umang-ubuntu-indicator-stickynotes-jammy.list<br>Adding key to /etc/apt/trusted.gpg.d/umang-ubuntu-indicator-stickynotes.gpg with fingerprint BFA3ED6C43427DA2DA04D7F4799A5FD5D1C5997F<br></code></pre></td></tr></table></figure>
<p>如何撤销这些操作：</p>
<ol type="1">
<li><p>删除
<code>/etc/apt/sources.list.d/umang-ubuntu-indicator-stickynotes-jammy.list</code>
文件中添加的 deb 条目和 deb-src 条目。您可以使用文本编辑器（如 nano 或
vim）来编辑这个文件，并删除相关行。</p></li>
<li><p>删除
<code>/etc/apt/trusted.gpg.d/umang-ubuntu-indicator-stickynotes.gpg</code>
文件中添加的密钥。您可以使用以下命令来删除该密钥：</p></li>
</ol>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo <span class="hljs-built_in">rm</span> /etc/apt/trusted.gpg.d/umang-ubuntu-indicator-stickynotes.gpg<br></code></pre></td></tr></table></figure>
<ol start="2" type="1">
<li>第二句的加速：将<code>/etc/apt/sources.list.d/umang-ubuntu-indicator-stickynotes-jammy.list</code>里对应的内容改成</li>
</ol>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">deb https://launchpad.proxy.ustclug.org/umang/indicator-stickynotes/ubuntu/ jammy main<br></code></pre></td></tr></table></figure>
<h3 id="ocrmypdf">ocrmypdf</h3>
<p>https://github.com/ocrmypdf/OCRmyPDF</p>
<p>使用指南：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs bash">ocrmypdf                      <span class="hljs-comment"># it&#x27;s a scriptable command line program</span><br>   -l eng+fra                 <span class="hljs-comment"># it supports multiple languages</span><br>   --rotate-pages             <span class="hljs-comment"># it can fix pages that are misrotated</span><br>   --deskew                   <span class="hljs-comment"># it can deskew crooked PDFs!</span><br>   --title <span class="hljs-string">&quot;My PDF&quot;</span>           <span class="hljs-comment"># it can change output metadata</span><br>   --<span class="hljs-built_in">jobs</span> 4                   <span class="hljs-comment"># it uses multiple cores by default</span><br>   --output-type pdfa         <span class="hljs-comment"># it produces PDF/A by default</span><br>   input_scanned.pdf          <span class="hljs-comment"># takes PDF input (or images)</span><br>   output_searchable.pdf      <span class="hljs-comment"># produces validated PDF output</span><br></code></pre></td></tr></table></figure>
<p>查看 tesseract 能使用的语言包:</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">ls</span> /usr/share/tesseract-ocr/5/tessdata -l -h<br></code></pre></td></tr></table></figure>
<p>例子：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">ocrmypdf -l chi_sim_v3+eng --rotate-pages --deskew --<span class="hljs-built_in">jobs</span> 4 --output-type pdfa 数据库系统概念.pdf 数据库系统概念_ocr.pdf<br></code></pre></td></tr></table></figure>
<h4 id="tesseract-文字方向检测">tesseract 文字方向检测</h4>
<p>https://github.com/tesseract-ocr/tessdata/raw/3.04.00/osd.traineddata</p>
<h4 id="更准确的tesseract中文包">更准确的tesseract中文包</h4>
<p>https://github.com/gumblex/tessdata_chi?tab=readme-ov-file</p>
<h3 id="vmware">vmware</h3>
<h3 id="vm-pro-17">VM pro 17</h3>
<p>安装教程：https://docs.vmware.com/cn/VMware-Workstation-Pro/17/com.vmware.ws.using.doc/GUID-1F5B1F14-A586-4A56-83FA-2E7D8333D5CA.html</p>
<p>下载链接：https://www.vmware.com/cn/products/workstation-pro/workstation-pro-evaluation.html</p>
<p>民间安装教程：https://www.cnblogs.com/wthuskyblog/p/16349940.html</p>
<p>破解：https://www.52pojie.cn/thread-1804571-1-1.html</p>
<p>卸载：https://docs.vmware.com/cn/VMware-Workstation-Pro/17/com.vmware.ws.using.doc/GUID-05E4C876-F32C-49D2-82B4-8C759691E7F5.html</p>
<p>https://zhuanlan.zhihu.com/p/655902568</p>
<p>VMware Workstation v17.x 永久许可证激活密钥：
MC60H-DWHD5-H80U9-6V85M-8280D 4A4RR-813DK-M81A9-4U35H-06KND
NZ4RR-FTK5H-H81C1-Q30QH-1V2LA JU090-6039P-08409-8J0QH-2YR7F
4Y09U-AJK97-089Z0-A3054-83KLA 4C21U-2KK9Q-M8130-4V2QH-CF810</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br></pre></td><td class="code"><pre><code class="hljs bash">sh VMware-Workstation-xxxx-xxxxxxx.architecture.bundle [--option]<br><span class="hljs-comment"># xxxx-xxxxxxx 是版本号和内部版本号， architecture 为 x86_64， option 是命令行选项。</span><br><br><span class="hljs-comment"># 接受开放虚拟化格式 (OVF) 工具许可协议。</span><br><span class="hljs-comment"># 如果您使用 --console 选项，或在不支持 GUI 向导的主机系统中安装 Workstation Pro，请按 Enter 键滚动浏览，阅读许可协议，或者键入 q 跳到 **[是/否]**提示。</span><br><br><span class="hljs-comment"># 安装记录</span><br>sudo ./VMware-Workstation-Full-17.5.0-22583795.x86_64.bundle --console<br>[sudo] password <span class="hljs-keyword">for</span> joelee: <br>Extracting VMware Installer...<span class="hljs-keyword">done</span>.<br>You must accept the VMware Workstation End User License Agreement to<br><span class="hljs-built_in">continue</span>.  Press Enter to proceed.<br>...<br>14.21. Replace Section 13.23 (<span class="hljs-string">&quot;VMware,&quot;</span> <span class="hljs-string">&quot;We,&quot;</span> or <span class="hljs-string">&quot;Us&quot;</span>) with the following:<br><span class="hljs-string">&quot;&#x27;VMware,&#x27; &#x27;We,&#x27; or &#x27;Us&#x27; means VMware, Inc., a Delaware corporation.&quot;</span><br><span class="hljs-comment"># 要注意它是默认你不同意的</span><br>Do you agree? [<span class="hljs-built_in">yes</span>/no]:<br><br>12.12  Contact Information.  Please direct legal notices or other<br>correspondence to VMware, Inc., 3401 Hillview Avenue, Palo Alto, California<br>94304, United States of America.  If You have any questions concerning this<br>EULA, please send an email to info@vmware.com.<br><br>Do you agree? [<span class="hljs-built_in">yes</span>/no]: <br><br><span class="hljs-comment"># 过完这个后就好多了</span><br>Enter license key. (optional) You can enter this information later.: <span class="hljs-comment"># 之后再输入</span><br><br>The product is ready to be installed.  Press Enter to begin<br>installation or Ctrl-C to cancel.<br><br>Installing VMware Workstation 17.5.0<br>    Configuring...<br>[<span class="hljs-comment">######################################################################] 100%</span><br>Installation was successful.<br></code></pre></td></tr></table></figure>
<p>卸载：<code>vmware-installer -u vmware-workstation</code></p>
<p><strong>坑</strong>：</p>
<p>（1）首次开启虚拟机时出现弹窗：</p>
<img src="/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/image-20231207213817907.png" srcset="/myblog/img/loading.gif" lazyload class="" title="image-20231207213817907">
<blockquote>
<p>https://www.cnblogs.com/wthuskyblog/p/16349940.html</p>
<p>https://blog.csdn.net/HuoRan0614/article/details/86709945</p>
</blockquote>
<p>首先要清楚“sercure
boot”的安全验证是通过“安全密钥”机制来实现的，即每个操作系统或驱动程序必须对应一个“密钥对”，其中的“公钥”是内置与主板中的，“私钥”则附在自身上，只有”公钥“和“私钥”能够对应上，该程序才可以执行。我们要想让VMware驱动器运行，也必须为它创建“密钥对”。具体操作如下：</p>
<ol type="1">
<li>为vmmon和vmnet组件生成密钥对</li>
</ol>
<figure class="highlight asciidoc"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs asciidoc">openssl req -new -x509 -newkey rsa:2048 -keyout VMW.priv -outform DER -out VMW.der -nodes -days 36500 -subj &quot;/CN=VMware/&quot;<br><br>CN=VMware/&quot;<br>......<span class="hljs-code">+.....+</span>....<span class="hljs-code">+......+</span>.....<span class="hljs-code">+.......+</span>............<span class="hljs-code">+.........+</span>...............<span class="hljs-code">+..+</span>.......<span class="hljs-code">+++</span><span class="hljs-code">+++</span><span class="hljs-code">+++</span><span class="hljs-code">+++</span><span class="hljs-code">+++</span><span class="hljs-code">+++</span><span class="hljs-code">+++</span><span class="hljs-code">+++</span><span class="hljs-code">+++</span><span class="hljs-code">+++</span><span class="hljs-code">+++</span><span class="hljs-code">+++</span><span class="hljs-code">+++</span><span class="hljs-strong">*.+................+.....+.+...+..+.............+..+.+............+...+...+..+.............+......+...+........+...+.........+++++++++++++++++++++++++++++++++++++++*</span>............<span class="hljs-code">+.+</span>.....<span class="hljs-code">+.+</span>...<span class="hljs-code">+..+</span>...<span class="hljs-code">+...+</span>.........<span class="hljs-code">+......+</span>.......<span class="hljs-code">+............+</span>.....<span class="hljs-code">+++</span><span class="hljs-code">+++</span><br><span class="hljs-section">...+................+.....+.+................................+...+....+........+.......+...+..+.........................+........+...+....+.....+....+..+.......+..+......+.......+.....+.............+..+.+.....+.+.....+.+...+.....+++++++++++++++++++++++++++++++++++++++*.+...+++++++++++++++++++++++++++++++++++++++*.......+....+...........+.....................+.+..+.+..+....+........+.+..+...............+...+.+......+.................+.+............+.....+.........+...............+...+.+.........+..+.........+....+...+...+............+..+.+......+........+.+.....+.........+......+.+...........+...+....+...+.....+...........................+.+......+...+......+............+..+.+..+.......+..+...............+................+..+...+....+...+........+...+.........+.............+..+.+.....+......+.+............+.....+...+...+.......+...+..+..........+.....+.......+..+...+...............+.+.........+.................+.+.....+.........+...+...+.......+..+......+.......+...+..+.+..............+.......+......+........+....+...+..+.......+.....+..........+......+..+................+...........+.+..............+....+.................+...+...............+.+.....+..........+.....+.........+.......+.....+...+......+......+.............+.....+.......+.................+.+.....+.+........+.......+......+..+................+..+.......+..+...+...+....+...+............+..............+.........++++++</span><br><span class="hljs-section">-----</span><br></code></pre></td></tr></table></figure>
<p>   VMW.der 是公钥（证书文件），VMW.priv是私钥   
(其中的“VMW”是密钥的名字，也可以改成别的）</p>
<ol type="1">
<li>为vmmon和vmnet组件附上生成的密钥</li>
</ol>
<figure class="highlight gams"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs gams">sudo /usr/src/linux-headers-<span class="hljs-symbol">$</span>(uname -r)/scripts/<span class="hljs-built_in">sign</span>-<span class="hljs-keyword">file</span> sha256 ./VMW.priv ./VMW.der <span class="hljs-symbol">$</span>(modinfo -n vmmon)<br>sudo /usr/src/linux-headers-<span class="hljs-symbol">$</span>(uname -r)/scripts/<span class="hljs-built_in">sign</span>-<span class="hljs-keyword">file</span> sha256 ./VMW.priv ./VMW.der <span class="hljs-symbol">$</span>(modinfo -n vmnet)<br></code></pre></td></tr></table></figure>
<ol type="1">
<li>将公钥插入系统的MOK列表中</li>
</ol>
<figure class="highlight actionscript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs actionscript">sudo mokutil --<span class="hljs-meta"><span class="hljs-keyword">import</span> VMW.der</span><br></code></pre></td></tr></table></figure>
<p>  这一步会让你创建一个密码，记住这个密码，一会儿有用。这个密码很重要。</p>
<ol type="1">
<li>重启电脑
重启时会进入到一个类似于BIOS的界面（UEFI界面），这一步忘记截图了，总之，根据界面上的说明进行选择，完成密钥的插入（最后让输入的密码即为上一步设置的密码）。开启电脑后，VMware就能正常运行了。</li>
</ol>
<h3 id="tldrman的替代品">tldr(man的替代品)</h3>
<p>https://github.com/tldr-pages/tldr?tab=readme-ov-file</p>
<h2 id="文字工作">文字工作</h2>
<h3 id="okular">okular</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt install okular  <span class="hljs-comment"># 35.1 MB</span><br></code></pre></td></tr></table></figure>
<p>安装包：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs bash">libchm1 libkf5js5 libkf5jsapi5 libkf5kexiv2-15.0.0 libkf5khtml-bin<br>libkf5khtml-data libkf5khtml5 libkf5pty-data libkf5pty5 libkf5threadweaver5<br>libmarkdown2 libokular5core9 libphonon4qt5-4 libphonon4qt5-data okular<br>okular-extra-backends phonon4qt5 phonon4qt5-backend-vlc<br>qtspeech5-flite-plugin<br></code></pre></td></tr></table></figure>
<h3 id="texlive">texlive</h3>
<h4 id="texlive-fontconfig.conf">texlive-fontconfig.conf</h4>
<p>文件位于<code>/usr/local/texlive/2023/texmf-var/fonts/conf/texlive-fontconfig.conf</code>，根据lshort中的<a
target="_blank" rel="noopener" href="https://www.tug.org/texlive/doc/texlive-zh-cn/texlive-zh-cn.pdf">安装文档</a>，安装完texlive后还需要</p>
<blockquote>
<p>然而实际操作时发现wps-office也识别到texlive的字体，导致wps在切换字体时过于慢，因为太多字体了。</p>
</blockquote>
<p>有root权限时：</p>
<ol type="1">
<li><p>将 texlive-fontconfig.conf 文件复制到
<code>/etc/fonts/conf.d/09-texlive.conf</code>。
其实只需要做一个链接的效果即可。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">ln</span> -s /usr/local/texlive/2023/texmf-var/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-texlive.conf<br></code></pre></td></tr></table></figure></li>
<li><p>运行 <code>sudo fc-cache -fsv</code>。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">/usr/local/texlive/2023/texmf-dist/fonts/opentype: caching, new cache contents: 0 fonts, 16 <span class="hljs-built_in">dirs</span><br>/usr/local/texlive/2023/texmf-dist/fonts/truetype: caching, new cache contents: 0 fonts, 14 <span class="hljs-built_in">dirs</span><br>/usr/local/texlive/2023/texmf-dist/fonts/type1: caching, new cache contents: 0 fonts, 33 <span class="hljs-built_in">dirs</span><br></code></pre></td></tr></table></figure>
<p>这会在<code>/var/cache/fontconfig/</code>下构建系统级别的字体信息缓存文件。使用<code>sudo rm -rf /var/cache/fontconfig/*</code>删除缓存文件，再重新<code>fc-cache -fsv</code>。</p></li>
</ol>
<blockquote>
<p>TEXMFSYSVAR/fonts/conf/texlive-fontconfig.conf</p>
</blockquote>
<p>无root权限时：</p>
<ol type="1">
<li>将 texlive-fontconfig.conf 文件复制到 ~/.fonts.conf，其中 ~
是你的主目录。 2. 运行 fc-cache -fv。</li>
</ol>
<blockquote>
<p>在<code>/etc/fonts/conf.avail</code>下创建<code>09-system.conf</code>文件，写入</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs xml"><span class="hljs-meta">&lt;?xml version=<span class="hljs-string">&quot;1.0&quot;</span>?&gt;</span><br><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-keyword">fontconfig</span> <span class="hljs-keyword">SYSTEM</span> <span class="hljs-string">&quot;fonts.dtd&quot;</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">fontconfig</span>&gt;</span><br>  <span class="hljs-tag">&lt;<span class="hljs-name">dir</span>&gt;</span>/usr/share/fonts/opentype<span class="hljs-tag">&lt;/<span class="hljs-name">dir</span>&gt;</span><br>  <span class="hljs-tag">&lt;<span class="hljs-name">dir</span>&gt;</span>/usr/share/fonts/truetype<span class="hljs-tag">&lt;/<span class="hljs-name">dir</span>&gt;</span><br>  <span class="hljs-tag">&lt;<span class="hljs-name">dir</span>&gt;</span>/usr/share/fonts/type1<span class="hljs-tag">&lt;/<span class="hljs-name">dir</span>&gt;</span><br>  <span class="hljs-tag">&lt;<span class="hljs-name">dir</span>&gt;</span>/usr/share/fonts/windows-font<span class="hljs-tag">&lt;/<span class="hljs-name">dir</span>&gt;</span><br>  <span class="hljs-tag">&lt;<span class="hljs-name">dir</span>&gt;</span>/usr/share/fonts/wps-office<span class="hljs-tag">&lt;/<span class="hljs-name">dir</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">fontconfig</span>&gt;</span><br></code></pre></td></tr></table></figure>
<p>再<code>ln -s /etc/fonts/conf.avail/09-system.conf /etc/fonts/conf.d/09-system.conf</code>
，再 <code>sudo fc-cache -fsv</code></p>
</blockquote>
<h4 id="vscode配置">vscode配置</h4>
<p>https://github.com/YanMing-lxb/YM-VSCode-Configurations-for-LaTeX?tab=readme-ov-file</p>
<p><a
target="_blank" rel="noopener" href="https://github.com/YanMing-lxb/YM-VSCode-Configurations-for-LaTeX/blob/main/Docs/LaTeXMK%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E.md">latexmkrc</a></p>
<h3 id="winapps">winapps</h3>
<p>https://github.com/winapps-org/winapps?tab=readme-ov-file</p>
<p>视频链接：【在linux上安装微软office】
https://www.bilibili.com/video/BV1zY4y1v7GV/?share_source=copy_web&amp;vd_source=27c25a22c9be568ad81c1a881e1c59ae</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-comment"># install kvm</span><br>sudo apt-fast install virt-manager<br><span class="hljs-comment"># 33 items, 22.2MB, 4.0.0.1</span><br><span class="hljs-comment"># gir1.2-gtk-vnc-2.0 gir1.2-libosinfo-1.0 gir1.2-libvirt-glib-1.0 gir1.2-spiceclientglib-2.0 gir1.2-spiceclientgtk-3.0 libburn4 libgovirt-common libgovirt2 libgtk-vnc-2.0-0 libgvnc-1.0-0 libisoburn1 libisofs6 libjte2 libosinfo-1.0-0 libphodav-2.0-0 libphodav-2.0-common libspice-client-glib-2.0-8 libspice-client-gtk-3.0-5 libusbredirhost1 libvirt-glib-1.0-0 libvirt-glib-1.0-data osinfo-db python3-certifi python3-idna python3-libvirt python3-libxml2 python3-requests python3-urllib3 spice-client-glib-usb-acl-helper virt-manager virt-viewer virtinst xorriso</span><br><br><span class="hljs-comment"># Download the Windows Professional and KVM VirtIO drivers</span><br><span class="hljs-comment"># Windows 10 ISO: https://www.microsoft.com/en-us/software-download/windows10ISO</span><br><span class="hljs-comment"># KVM VirtIO drivers (for all distros): https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso</span><br></code></pre></td></tr></table></figure>
<p>这个太卡顿了，放弃。。。后来重试了一次，可以成功，不过感觉电脑的风扇老在转，所以只能到使用的时候再打开，另外好像无法读取ubuntu文件夹里的文件。</p>
<h3 id="office-2019-crossover">office 2019 (crossover)</h3>
<p>首先安装crossover，其目录位于 <code>/opt/cxoffice/</code> ，占据 810
MB。配置目录：<code>~/cxoffice</code> 。</p>
<p>卸载：<code>sudo apt-fast autoremove crossover</code>
，<code>896MB</code> 。</p>
<p>office单组件：https://juejin.cn/post/7249926456885035067</p>
<h3 id="office-2013spark-store">office 2013(spark-store)</h3>
<p>spark-store商店占据的安装位置：<code>/opt/&#123;apps, spark-wine8, durapps, deepinwine, bashimport, p7zip-legacy&#125;</code>
以及 <code>~/.deepinwine</code> 和 <code>~/.config/spark-wine</code></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-comment"># 81 items &gt;= 4GB</span><br>gstreamer1.0-plugins-base:i386 libavahi-client3:i386 libavahi-common-data:i386 libavahi-common3:i386 libbz2-1.0:i386 libcdparanoia0:i386 libcups2:i386 libcurl3-gnutls:i386 libcurl4:i386 libdeflate0:i386 libdw1:i386 libexif12:i386 libgd3:i386 libgdbm-compat4:i386 libgdbm6:i386 libglu1-mesa:i386 libgphoto2-6:i386 libgphoto2-port12:i386 libgpm2:i386 libgstreamer-plugins-base1.0-0:i386 libgstreamer1.0-0:i386 libieee1284-3:i386 libjbig0:i386 libjpeg-turbo8:i386 libjpeg8:i386 liblcms2-2:i386 libldap-2.4-2 libldap-2.4-2:i386 libldap-2.5-0:i386 libltdl7:i386 libncurses6:i386 libnghttp2-14:i386 libnspr4:i386 libnss3:i386 libodbc1 libodbc1:i386 libodbc2:i386 libodbccr2 libodbccr2:i386 libopenal1:i386 libopengl0:i386 libopenjp2-7:i386 liborc-0.4-0:i386 libosmesa6 libosmesa6:i386 libpcap0.8:i386 libpci3:i386 libperl5.34:i386 libpoppler-glib8:i386 libpoppler118:i386 libpsl5:i386 librtmp1:i386 libsane1:i386 libsasl2-2:i386 libsasl2-modules:i386 libsasl2-modules-db:i386 libsndio7.0:i386 libsnmp40:i386 libsqlite3-0:i386 libssh-4:i386 libtheora0:i386 libtiff5:i386 libunwind8:i386 libusb-1.0-0:i386 libv4l-0:i386 libv4lconvert0:i386 libvisual-0.4-0:i386 libwebp7:i386 libwrap0:i386 libxcomposite1:i386 libxpm4:i386 ocl-icd-libopencl1:i386 p7zip-legacy spark-dwine-helper spark-dwine-helper-settings spark-office spark-wine8 spark-wine8-amd64 spark-wine8-i386:i386 spark-winehq8 transhell<br></code></pre></td></tr></table></figure>
<p>实测证明，这是真的不好用，呜呜呜。。。</p>
<p>卸载：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs bash">spark-store-console<br><span class="hljs-comment"># 先在这里卸载office2013</span><br><br>sudo apt-fast autoremove<br><span class="hljs-comment"># gstreamer1.0-plugins-base:i386 libavahi-client3:i386 libavahi-common-data:i386 libavahi-common3:i386 libcdparanoia0:i386 libcups2:i386 libcurl3-gnutls:i386 libcurl4:i386 libdeflate0:i386 libdw1:i386 libexif12:i386 libgd3:i386 libgdbm-compat4:i386 libgdbm6:i386 libglu1-mesa:i386 libgphoto2-6:i386 libgphoto2-port12:i386 libgstreamer-plugins-base1.0-0:i386 libgstreamer1.0-0:i386 libieee1284-3:i386 libjbig0:i386 libjpeg-turbo8:i386 libjpeg8:i386 liblcms2-2:i386 libldap-2.4-2 libldap-2.4-2:i386 libldap-2.5-0:i386 libltdl7:i386 libnghttp2-14:i386 libnspr4:i386 libnss3:i386 libodbc1 libodbc1:i386 libodbc2:i386 libodbccr2 libodbccr2:i386 libopenal1:i386 libopengl0:i386 libopenjp2-7:i386 liborc-0.4-0:i386 libosmesa6 libosmesa6:i386 libpcap0.8:i386 libpci3:i386 libperl5.34:i386 libpoppler-glib8:i386 libpoppler118:i386 libpsl5:i386 librtmp1:i386 libsane1:i386 libsasl2-2:i386 libsasl2-modules:i386 libsasl2-modules-db:i386 libsndio7.0:i386 libsnmp40:i386 libsqlite3-0:i386 libssh-4:i386 libtheora0:i386 libtiff5:i386 libunwind8:i386 libusb-1.0-0:i386 libv4l-0:i386 libv4lconvert0:i386 libvisual-0.4-0:i386 libwebp7:i386 libwrap0:i386 libxcomposite1:i386 libxpm4:i386 ocl-icd-libopencl1:i386 p7zip-legacy spark-dwine-helper spark-dwine-helper-settings spark-wine8 spark-wine8-amd64 spark-wine8-i386:i386 spark-winehq8 transhell</span><br><br></code></pre></td></tr></table></figure>
<h3 id="office2013-playonlinux">office2013 (playonlinux)</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt-fast update<br>sudo apt-fast install playonlinux<br><span class="hljs-comment"># 577MB 26 items</span><br><span class="hljs-comment"># fonts-wine icoutils libcapi20-3:i386 libfaudio0:i386 libgsm1:i386</span><br><span class="hljs-comment"># libodbc2:i386 libopenal1:i386 libosmesa6:i386 libpcap0.8:i386</span><br><span class="hljs-comment"># libsndio7.0:i386 libstb0:i386 libvkd3d1:i386 libwine:i386 libxslt1.1:i386</span><br><span class="hljs-comment"># libz-mingw-w64 mesa-utils mesa-utils-bin ocl-icd-libopencl1:i386 p7zip</span><br><span class="hljs-comment"># p7zip-full playonlinux python3-natsort python3-numpy python3-wxgtk4.0 wine</span><br><span class="hljs-comment"># wine32:i386</span><br><br><span class="hljs-comment"># 卸载</span><br>sudo apt-fast autoremove --purge playonlinux<br><span class="hljs-comment">#  fonts-wine* icoutils* libcapi20-3:i386* libfaudio0:i386* libgsm1:i386* libodbc2:i386* libopenal1:i386* libosmesa6:i386* libpcap0.8:i386* libsndio7.0:i386* libstb0:i386* libvkd3d1:i386* libwine:i386* libxslt1.1:i386* libz-mingw-w64* ocl-icd-libopencl1:i386* playonlinux* python3-natsort* python3-numpy* python3-wxgtk4.0* wine* wine32:i386*</span><br></code></pre></td></tr></table></figure>
<p>目录：<code>/usr/share/playonlinux/</code>
<code>~/.PlayOnLinux</code>
<code>~/"PlayOnLinux's virtual drives"</code>
<code>/usr/share/python3</code></p>
<p>在<code>/usr/share/applications/PlayOnLinux.desktop</code>加上<code>env GTK_THEME=Pop-light</code></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">Exec=<span class="hljs-built_in">env</span> GTK_THEME=Pop-light playonlinux %F<br></code></pre></td></tr></table></figure>
<p>安装office2010时出错，显示没有安装winbind</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt-fast install winbind<br><span class="hljs-comment"># 28.8MB</span><br><span class="hljs-comment"># python3-gpg python3-samba python3-tdb samba-common samba-common-bin samba-dsdb-modules winbind</span><br></code></pre></td></tr></table></figure>
<p><a
target="_blank" rel="noopener" href="https://www.bilibili.com/video/BV1Ey4y1e7Zf?p=1">参考B站某视频</a></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt-fast install wine<br><span class="hljs-comment"># 24 items 1079MB</span><br><span class="hljs-comment"># fonts-wine libcapi20-3 libcapi20-3:i386 libfaudio0 libfaudio0:i386 libgsm1:i386 libodbc2:i386 libopenal1:i386 libosmesa6 libosmesa6:i386 libpcap0.8:i386 libsndio7.0:i386 libstb0 libstb0:i386 libvkd3d1 libvkd3d1:i386 libwine libwine:i386 libxslt1.1:i386 libz-mingw-w64 ocl-icd-libopencl1:i386 wine wine32:i386 wine64</span><br></code></pre></td></tr></table></figure>
<p>好麻烦，呜呜呜。。。</p>
<h3 id="libreoffice">libreoffice</h3>
<p><a
target="_blank" rel="noopener" href="https://zh-cn.libreoffice.org/download/libreoffice/">官网</a>
有最新版和稳定版，我选择最新版 24.2.1
，下载完压缩包后解压，进入子文件夹，里有 <code>DEBS</code> 和
<code>readmes</code> 文件。进入 <code>DEBS</code> 文件夹，</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo dpkg -i *.deb<br></code></pre></td></tr></table></figure>
<p>安装的包有：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-comment"># 42个包</span><br>libobasis24.2-ooofonts libreoffice24.2-debian-menus libreoffice24.2-ure libobasis24.2-core libobasis24.2-draw libobasis24.2-en-us libobasis24.2-extension-beanshell-script-provider libobasis24.2-extension-javascript-script-provider libobasis24.2-extension-mediawiki-publisher libobasis24.2-extension-nlpsolver libobasis24.2-extension-pdf-import libobasis24.2-extension-report-builder libobasis24.2-firebird libobasis24.2-gnome-integration libobasis24.2-graphicfilter libobasis24.2-images libobasis24.2-impress libobasis24.2-kde-integration libobasis24.2-libreofficekit-data libobasis24.2-math libobasis24.2-ogltrans libobasis24.2-onlineupdate libobasis24.2-ooolinguistic libobasis24.2-python-script-provider libobasis24.2-pyuno libobasis24.2-writer libobasis24.2-xsltfilter libreoffice24.2 libobasis24.2-base libobasis24.2-calc libobasis24.2-librelogo libobasis24.2-postgresql-sdbc libreoffice24.2-base libreoffice24.2-calc libreoffice24.2-dict-en libreoffice24.2-dict-es libreoffice24.2-dict-fr libreoffice24.2-draw libreoffice24.2-en-us libreoffice24.2-impress libreoffice24.2-math libreoffice24.2-writer<br></code></pre></td></tr></table></figure>
<p>中文包：<code>libobasis24.2-zh-cn</code>
、<code>libreoffice24.2-zh-cn</code></p>
<p>计算大小：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">dpkg-query -W --showformat=<span class="hljs-string">&#x27;$&#123;Installed-Size&#125;\n&#x27;</span> libobasis24.2-ooofonts libreoffice24.2-debian-menus libreoffice24.2-ure libobasis24.2-core libobasis24.2-draw libobasis24.2-en-us libobasis24.2-extension-beanshell-script-provider libobasis24.2-extension-javascript-script-provider libobasis24.2-extension-mediawiki-publisher libobasis24.2-extension-nlpsolver libobasis24.2-extension-pdf-import libobasis24.2-extension-report-builder libobasis24.2-firebird libobasis24.2-gnome-integration libobasis24.2-graphicfilter libobasis24.2-images libobasis24.2-impress libobasis24.2-kde-integration libobasis24.2-libreofficekit-data libobasis24.2-math libobasis24.2-ogltrans libobasis24.2-onlineupdate libobasis24.2-ooolinguistic libobasis24.2-python-script-provider libobasis24.2-pyuno libobasis24.2-writer libobasis24.2-xsltfilter libreoffice24.2 libobasis24.2-base libobasis24.2-calc libobasis24.2-librelogo libobasis24.2-postgresql-sdbc libreoffice24.2-base libreoffice24.2-calc libreoffice24.2-dict-en libreoffice24.2-dict-es libreoffice24.2-dict-fr libreoffice24.2-draw libreoffice24.2-en-us libreoffice24.2-impress libreoffice24.2-math libreoffice24.2-writer | awk <span class="hljs-string">&#x27;&#123;s+=$1&#125; END &#123;print s&#125;&#x27;</span><br></code></pre></td></tr></table></figure>
<h3 id="wps">WPS</h3>
<p>WPS的字体文件存储在 <code>/usr/share/fonts/wps-office</code>
。WPS初次打开时缺失和需要的（中文）字体文件有：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">DejaVuMathTeXGyre.ttf  msyh.ttc    mtextra.ttf  simkai.ttf  wingding.ttf<br>WINGDNG2.ttf           msyhbd.ttc  simfang.ttf  simsun.ttc<br>WINGDNG3.ttf           msyhl.ttc   simhei.ttf   symbol.ttf<br></code></pre></td></tr></table></figure>
<p>准备好以上文件，将它们复制到 <code>/usr/share/fonts/wps-office</code>
目录下，然后在 <code>/usr/share/fontswps-office</code> 目录下执行</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo mkfontscale <span class="hljs-comment"># create an index of scalable font files for X,它会在当前目录下查找每个文件夹里的字体文件,并且在当前目录下的 fonts.scale 里记录每个找到的entry</span><br>sudo mkfontdir <span class="hljs-comment"># create an index of X font files in a directory,查找并存储在 fonts.dir 下</span><br>sudo fc-cache<br></code></pre></td></tr></table></figure>
<p>再重启WPS，并设置为中文语言，即可以看到字体选项出现了
<code>宋体</code> 等中文字体。</p>
<blockquote>
<p><a
target="_blank" rel="noopener" href="https://blog.csdn.net/qq_38863413/article/details/105484539">如何获取中文字体文件？</a></p>
<p><a
target="_blank" rel="noopener" href="https://pan.baidu.com/s/14dfzUrKzW_OJO4daErCLPQ">缺失字体文件</a>
提取码: 8888</p>
</blockquote>
<h3 id="pdf-studio-12">PDF Studio 12</h3>
<p><a target="_blank" rel="noopener" href="https://rutracker.net/forum/viewtopic.php?t=5332940">crack
version</a> ，使用过程中若出现需要激活的弹窗，则删掉
<code>~/.pdfstudio12</code> 再重新打开pdfstudio即可。</p>
<h3 id="xmind-2023">xmind 2023</h3>
<p><a
target="_blank" rel="noopener" href="https://github.com/henryau53/xmind-crack-patch">crack</a></p>
<h3 id="zotero">Zotero</h3>
<p><a target="_blank" rel="noopener" href="https://www.zotero.org/">Zotero 官网</a></p>
<h4 id="安装">安装</h4>
<p>Download the tarball, extract the contents, and run
<code>zotero</code> from that directory to start Zotero.</p>
<p>For Ubuntu, the tarball includes a .desktop file that can be used to
add Zotero to the launcher:</p>
<ol type="1">
<li>Move the extracted directory to a location of your choice (e.g.,
<code>/opt/zotero</code>).</li>
<li>Run the <code>set_launcher_icon</code> script from a terminal to
update the .desktop file for that location. .desktop files require
absolute paths for icons, so <code>set_launcher_icon</code> replaces the
icon path with the current location of the icon based on where you've
placed the directory.</li>
<li>Symlink <code>zotero.desktop</code> into
<code>~/.local/share/applications/</code> (e.g.,
<code>ln -s /opt/zotero/zotero.desktop ~/.local/share/applications/zotero.desktop</code>)</li>
</ol>
<p>Zotero should then appear either in your launcher or in the
applications list when you click the grid icon (“Show Applications”),
from which you can drag it to the launcher.</p>
<blockquote>
<p>安装完后记得进入 Zotero，自定义其数据存放的地址。</p>
</blockquote>
<h4 id="推荐的插件">推荐的插件</h4>
<p><a
target="_blank" rel="noopener" href="https://www.cnblogs.com/BoyaYan/p/17310302.html">参考文章</a></p>
<p>问题：Jasminum 插件需要 pdftk 才能显示 PDF 的书签，但是 pdftk
好像没有 linux 的二进制版本，因此需要自行编译。</p>
<blockquote>
<p><a
target="_blank" rel="noopener" href="https://packages.ubuntu.com/source/jammy/pdftk-java">pdftk-java需要的依赖</a>：<a
target="_blank" rel="noopener" href="https://mirrors.tuna.tsinghua.edu.cn/ubuntu/pool/universe/a/ant/">ant</a>
<a
target="_blank" rel="noopener" href="https://mirrors.tuna.tsinghua.edu.cn/ubuntu/pool/universe/b/bouncycastle/">libbcprov</a>
<a
target="_blank" rel="noopener" href="https://mirrors.tuna.tsinghua.edu.cn/ubuntu/pool/universe/a/apache-pom/">apache-pom</a>
<a
target="_blank" rel="noopener" href="https://mirrors.tuna.tsinghua.edu.cn/ubuntu/pool/universe/c/commons-parent/">commons-parent</a>
<a
target="_blank" rel="noopener" href="https://mirrors.tuna.tsinghua.edu.cn/ubuntu/pool/universe/libc/libcommons-lang3-java/">libcommons-lang3-java</a></p>
<p><strong>编译</strong>：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ <span class="hljs-built_in">ls</span> /usr/share/java/<br>ant-1.10.13.jar    ant-launcher-1.10.13.jar  bcprov.jar                java-atk-wrapper.jar  libintl.jar<br>ant-bootstrap.jar  ant-launcher.jar          commons-lang3-3.12.0.jar  java_defaults.mk<br>ant.jar            bcprov-1.72.jar           commons-lang3.jar         libintl-0.21.jar<br><br>$ git <span class="hljs-built_in">clone</span> https://gitlab.com/pdftk-java/pdftk.git<br>$ <span class="hljs-built_in">cd</span> pdftk<br>$ <span class="hljs-built_in">mkdir</span> lib<br>$ <span class="hljs-built_in">ln</span> -st lib /usr/share/java/&#123;commons-lang3,bcprov&#125;.jar<br>$ ant jar<br><span class="hljs-comment"># 运行jar包</span><br>$ java -jar build/jar/pdftk.jar --<span class="hljs-built_in">help</span><br><br><span class="hljs-comment"># 接下来我们尝试将jar包转换为可执行文件</span><br><span class="hljs-comment"># 参考: https://stackoverflow.com/questions/44427355/how-to-convert-jar-to-linux-executable-file</span><br>$ <span class="hljs-built_in">cd</span> build/jar<br>$ <span class="hljs-built_in">echo</span> <span class="hljs-string">&#x27;#!/usr/bin/java -jar&#x27;</span> &gt; pdftk<br>$ <span class="hljs-built_in">cat</span> pdftk.jar &gt;&gt; pdftk<br>$ <span class="hljs-built_in">chmod</span> +x pdftk<br>$ ./pdftk<br></code></pre></td></tr></table></figure>
<p><strong>编译完后可以卸载</strong>：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt autoremove --purge libcommons-lang3-java ant libbcprov-java<br>sudo apt autoremove --purge libcommons-parent-java libapache-pom-java<br></code></pre></td></tr></table></figure>
<img src="/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/sw-zotero-pdftk.png" srcset="/myblog/img/loading.gif" lazyload class="" title="image-20240107144840105">
</blockquote>
<h4 id="卸载">卸载</h4>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">rm</span> -rf ~/.local/share/applications/zotero.desktop<br>sudo <span class="hljs-built_in">rm</span> -rf /opt/zotero<br><span class="hljs-built_in">rm</span> -rf ~/Downloads/zotero/* <span class="hljs-comment"># 自己设置的数据文件夹</span><br></code></pre></td></tr></table></figure>
<h4 id="dark主题不协调">dark主题不协调</h4>
<p><a
target="_blank" rel="noopener" href="https://blog.furffisite.link/p/linux-darkmode-zotero-gui-issue/">参考文章</a></p>
<img src="/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/sw-zotero-darkthemebug.png" srcset="/myblog/img/loading.gif" lazyload class="" title="image-20240107145159756">
<p>因为Linux端的Zotero（<a
target="_blank" rel="noopener" href="https://aur.archlinux.org/packages/zotero-bin">AUR</a>）中有一部分元素的样式是由GTK控制的，因此当系统的GTK主题为深色主题时，Zotero的界面会呈现为这个样子。</p>
<p>根据<a
target="_blank" rel="noopener" href="https://forums.zotero.org/discussion/98693/theme-issue-some-parts-of-zoteros-gui-on-linux-are-controlled-by-gtk">这个帖子</a>，解决方案是通过环境变量在程序启动时指定其使用的GTK主题（<strong>明亮主题下效果最好</strong>），也就是：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ GTK_THEME=Pop-light zotero  <span class="hljs-comment"># Pop-light不可以变</span><br></code></pre></td></tr></table></figure>
<p>反映到Desktop文件上，就是在启动指令（Exec项）前加入<code>env GTK_THEME=Pop-light</code>。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs bash">[Desktop Entry]<br>Type=Application<br>Name=Zotero<br>Exec=<span class="hljs-built_in">env</span> GTK_THEME=Pop-light /usr/bin/zotero -url %U<br>...<br></code></pre></td></tr></table></figure>
<p>查看系统当前主题：<code>gsettings get org.gnome.desktop.interface gtk-theme</code></p>
<h3 id="博客">博客</h3>
<h4 id="hexo-常用命令">hexo 常用命令</h4>
<p><a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/docs/commands.html">官方文档</a></p>
<p>在安装完 hexo
搭建完个人博客之后，只需关注博客本地目录下的<code>source</code>文件夹，里面是博客所有文章的源代码，是博客的内容模板。<code>source</code>文件夹需要关注三个目录：</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs yaml"><span class="hljs-string">_drafts</span>	<span class="hljs-comment"># 博客草稿，不作为发布的文章</span><br><span class="hljs-string">_posts</span>	<span class="hljs-comment"># 即将发布的博客</span><br><span class="hljs-string">about</span>	<span class="hljs-comment"># 个人页</span><br></code></pre></td></tr></table></figure>
<p>（1）查看已有的文章：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">hexo list &lt;<span class="hljs-built_in">type</span>&gt;<br><span class="hljs-comment"># type = &#123;page, post, route, tag, category&#125;</span><br><span class="hljs-comment"># post包括draft</span><br></code></pre></td></tr></table></figure>
<p>（2）新建文章：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs bash">hexo new [layout] &lt;title&gt;<br><span class="hljs-comment"># layout = &#123;post, draft, page(此不常用)&#125;</span><br><br><span class="hljs-comment"># 示例</span><br>hexo new post <span class="hljs-string">&quot;first article&quot;</span>  <span class="hljs-comment"># 等价于 hexo n &quot;first article&quot;</span><br></code></pre></td></tr></table></figure>
<p>（3）删除文章：直接到 <code>source</code>
文件夹目录里删除对应文件即可，再重新生成即可。</p>
<p><a
target="_blank" rel="noopener" href="https://www.yuezeyi.com/294.html">完全删除文章(包括已发布)</a></p>
<p>（4）生成和本地预览博客：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">hexo g &amp;&amp; hexo s  <span class="hljs-comment"># 完整命令是 hexo generate &amp;&amp; hexo server</span><br></code></pre></td></tr></table></figure>
<p>若想生成文章时随时检测文章变动，可以使用 <code>hexo g -w</code> 或
<code>hexo g --watch</code> 。</p>
<p>若想本地预览时包括draft的文章，可以使用
<code>hexo s --drafts</code></p>
<p>（5）部署博客：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">hexo d <span class="hljs-comment"># 完整命令: hexo deploy</span><br></code></pre></td></tr></table></figure>
<p>（6）清除缓存文件 (<code>db.json</code>) 和已生成的静态文件
(<code>public</code>)：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">hexo clean<br></code></pre></td></tr></table></figure>
<p>（7）修改主题配置文件，直接打开 <code>_config.yml</code>
进行修改即可。</p>
<h3 id="zathura-小巧pdf阅读器">zathura 小巧pdf阅读器</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt install zathura<br><span class="hljs-comment"># libgirara-gtk3-3 zathura zathura-pdf-poppler 1038KB</span><br></code></pre></td></tr></table></figure>
<h3 id="translator-rs">translator-rs</h3>
<p>https://github.com/rikonaka/translator-rs</p>
<p><a
target="_blank" rel="noopener" href="https://blog.csdn.net/isinstance/article/details/126043018">作者博客</a></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt-fast install xsel<br>sudo <span class="hljs-built_in">mv</span> translator-rs /usr/local/bin<br></code></pre></td></tr></table></figure>
<h2 id="应用商店">应用商店</h2>
<h3 id="spark-store">spark-store</h3>
<blockquote>
<p>星火应用商店（GUI）：https://spark-app.store/download</p>
<p>星火应用商店（Console）：https://gitee.com/spark-store-project/spark-store</p>
</blockquote>
<p><strong>卸载</strong>：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt autoremove spark-*<br><span class="hljs-comment"># &#x27;spark-dwine-helper-settings&#x27; &#x27;spark-wine7-devel&#x27; &#x27;spark-winehq8&#x27; &#x27;spark-store&#x27; &#x27;spark-wine8&#x27; &#x27;spark-dwine-helper&#x27; &#x27;spark-wine8-amd64&#x27; &#x27;spark-wine8-i386:i386&#x27;</span><br><span class="hljs-comment"># 0 to upgrade, 0 to newly install, 193 to remove and 0 not to upgrade.</span><br><span class="hljs-comment"># After this operation, 2,020 MB disk space will be freed.</span><br><br>sudo apt autopurge spark-*<br>sudo <span class="hljs-built_in">rm</span> -rf /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list<br></code></pre></td></tr></table></figure>
<h3 id="卸载-wine">卸载 wine</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt autoremove wine<br>sudo apt purge wine<br><span class="hljs-built_in">rm</span> -r ~/.wine<br>sudo apt autoremove<br><span class="hljs-built_in">rm</span> -r ~/.local/share/applications/wine*<br><span class="hljs-built_in">rm</span> -r ~/.config/menus/applications-merged/wine*<br></code></pre></td></tr></table></figure>
<h2 id="网盘工具">网盘工具</h2>
<h3 id="小白羊网盘aliyundrive">小白羊网盘(aliyundrive)</h3>
<p><a target="_blank" rel="noopener" href="https://xbysite.pages.dev/">官网</a></p>
<p>每次更新小白羊网盘，总会使得下载文件时<code>aria2c</code>断开。其实每次更新，小白羊网盘都会覆盖掉上次设置的<code>aria2c</code>，导致使用它自带的<code>aria2c</code>时会出现问题，我们需要将系统的<code>aria2c</code>软链接到它的引擎目录下：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt-fast install aria2<br><span class="hljs-built_in">cd</span> /opt/小白羊云盘/resources/engine<br>sudo <span class="hljs-built_in">mv</span> aria2c aria2c_bak<br>sudo <span class="hljs-built_in">ln</span> /usr/bin/aria2c<br><span class="hljs-comment"># sudo rm -rf aria2c_bak</span><br></code></pre></td></tr></table></figure>
<h1 id="常用操作">常用操作</h1>
<h2 id="后台运行">后台运行</h2>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">nohup</span> myprogram &lt; input.txt &gt; output.txt &amp;<br><span class="hljs-comment"># input.txt 是代替标准输入流, output.txt 是代表标准输出流</span><br><span class="hljs-built_in">nohup</span> ./run.sh &gt; run.log 2&gt;&amp;1 &amp;<br></code></pre></td></tr></table></figure>
<h2 id="更换中文字体">更换中文字体</h2>
<p>查看系统安装的中文字体：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><code class="hljs bash">fc-list :lang=zh-cn<br><span class="hljs-comment"># 字体文件一般处于以下文件夹</span><br><span class="hljs-comment"># /usr/share/fonts/truetype/</span><br><span class="hljs-comment"># /usr/share/fonts/opentype/</span><br><span class="hljs-comment"># /usr/share/fonts/wps-office/</span><br><span class="hljs-comment"># 什么字体都没安装的情况下:</span><br><span class="hljs-comment"># /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK TC:style=Regular</span><br><span class="hljs-comment"># /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK HK:style=Regular</span><br><span class="hljs-comment"># /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK KR:style=Regular</span><br><span class="hljs-comment"># /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK JP:style=Regular</span><br></code></pre></td></tr></table></figure>
<p>配置：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo vi /etc/fonts/conf.d/64-language-selector-prefer.conf <br></code></pre></td></tr></table></figure>
<p>例如改成：</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br></pre></td><td class="code"><pre><code class="hljs xml"><span class="hljs-meta">&lt;?xml version=<span class="hljs-string">&quot;1.0&quot;</span>?&gt;</span><br><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-keyword">fontconfig</span> <span class="hljs-keyword">SYSTEM</span> <span class="hljs-string">&quot;fonts.dtd&quot;</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">fontconfig</span>&gt;</span><br>	<span class="hljs-tag">&lt;<span class="hljs-name">alias</span>&gt;</span><br>		<span class="hljs-tag">&lt;<span class="hljs-name">family</span>&gt;</span>sans-serif<span class="hljs-tag">&lt;/<span class="hljs-name">family</span>&gt;</span><br>		<span class="hljs-tag">&lt;<span class="hljs-name">prefer</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">family</span>&gt;</span>YaHei Consolas Hybrid<span class="hljs-tag">&lt;/<span class="hljs-name">family</span>&gt;</span><br>            <span class="hljs-tag">&lt;<span class="hljs-name">family</span>&gt;</span>Microsoft YaHei<span class="hljs-tag">&lt;/<span class="hljs-name">family</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">family</span>&gt;</span>WenQuanYi Micro Hei<span class="hljs-tag">&lt;/<span class="hljs-name">family</span>&gt;</span><br>			<span class="hljs-comment">&lt;!-- &lt;family&gt;Noto Sans CJK JP&lt;/family&gt; --&gt;</span><br>			<span class="hljs-comment">&lt;!-- &lt;family&gt;Noto Sans CJK KR&lt;/family&gt; --&gt;</span><br>			<span class="hljs-comment">&lt;!-- &lt;family&gt;Noto Sans CJK SC&lt;/family&gt; --&gt;</span><br>			<span class="hljs-comment">&lt;!-- &lt;family&gt;Noto Sans CJK TC&lt;/family&gt; --&gt;</span><br>			<span class="hljs-comment">&lt;!-- &lt;family&gt;Noto Sans CJK HK&lt;/family&gt; --&gt;</span><br>		<span class="hljs-tag">&lt;/<span class="hljs-name">prefer</span>&gt;</span><br>	<span class="hljs-tag">&lt;/<span class="hljs-name">alias</span>&gt;</span><br>	<span class="hljs-tag">&lt;<span class="hljs-name">alias</span>&gt;</span><br>		<span class="hljs-tag">&lt;<span class="hljs-name">family</span>&gt;</span>serif<span class="hljs-tag">&lt;/<span class="hljs-name">family</span>&gt;</span><br>		<span class="hljs-tag">&lt;<span class="hljs-name">prefer</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">family</span>&gt;</span>YaHei Consolas Hybrid<span class="hljs-tag">&lt;/<span class="hljs-name">family</span>&gt;</span><br>            <span class="hljs-tag">&lt;<span class="hljs-name">family</span>&gt;</span>Microsoft YaHei<span class="hljs-tag">&lt;/<span class="hljs-name">family</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">family</span>&gt;</span>WenQuanYi Micro Hei<span class="hljs-tag">&lt;/<span class="hljs-name">family</span>&gt;</span><br>			<span class="hljs-comment">&lt;!-- &lt;family&gt;Noto Serif CJK JP&lt;/family&gt; --&gt;</span><br>			<span class="hljs-comment">&lt;!-- &lt;family&gt;Noto Serif CJK KR&lt;/family&gt; --&gt;</span><br>			<span class="hljs-comment">&lt;!-- &lt;family&gt;Noto Serif CJK SC&lt;/family&gt; --&gt;</span><br>			<span class="hljs-comment">&lt;!-- &lt;family&gt;Noto Serif CJK TC&lt;/family&gt; --&gt;</span><br>		<span class="hljs-tag">&lt;/<span class="hljs-name">prefer</span>&gt;</span><br>	<span class="hljs-tag">&lt;/<span class="hljs-name">alias</span>&gt;</span><br>	<span class="hljs-tag">&lt;<span class="hljs-name">alias</span>&gt;</span><br>		<span class="hljs-tag">&lt;<span class="hljs-name">family</span>&gt;</span>monospace<span class="hljs-tag">&lt;/<span class="hljs-name">family</span>&gt;</span><br>		<span class="hljs-tag">&lt;<span class="hljs-name">prefer</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">family</span>&gt;</span>YaHei Consolas Hybrid<span class="hljs-tag">&lt;/<span class="hljs-name">family</span>&gt;</span><br>            <span class="hljs-tag">&lt;<span class="hljs-name">family</span>&gt;</span>Microsoft YaHei<span class="hljs-tag">&lt;/<span class="hljs-name">family</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">family</span>&gt;</span>WenQuanYi Micro Hei Mono<span class="hljs-tag">&lt;/<span class="hljs-name">family</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">family</span>&gt;</span>WenQuanYi Zen Hei Mono<span class="hljs-tag">&lt;/<span class="hljs-name">family</span>&gt;</span><br>			<span class="hljs-comment">&lt;!-- &lt;family&gt;Noto Sans Mono CJK JP&lt;/family&gt; --&gt;</span><br>			<span class="hljs-comment">&lt;!-- &lt;family&gt;Noto Sans Mono CJK KR&lt;/family&gt; --&gt;</span><br>			<span class="hljs-comment">&lt;!-- &lt;family&gt;Noto Sans Mono CJK SC&lt;/family&gt; --&gt;</span><br>			<span class="hljs-comment">&lt;!-- &lt;family&gt;Noto Sans Mono CJK TC&lt;/family&gt; --&gt;</span><br>			<span class="hljs-comment">&lt;!-- &lt;family&gt;Noto Sans Mono CJK HK&lt;/family&gt; --&gt;</span><br>		<span class="hljs-tag">&lt;/<span class="hljs-name">prefer</span>&gt;</span><br>	<span class="hljs-tag">&lt;/<span class="hljs-name">alias</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">fontconfig</span>&gt;</span><br></code></pre></td></tr></table></figure>
<p>再刷新字体：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo fc-cache -f -v   <br></code></pre></td></tr></table></figure>
<h2 id="使用x11协议的桌面">使用X11协议的桌面</h2>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo nano /etc/gdm3/custom.conf<br><span class="hljs-comment"># 设置 WaylandEnable=false</span><br></code></pre></td></tr></table></figure>
<p>或者在用户登录界面选择 X11 org 。</p>
<h2 id="连接外接显示器">连接外接显示器</h2>
<p>只有在连接外接显示器的时候，才能在 <code>settings-display</code>
里找到相关设置和选项。</p>
<p>只有在设置join
display、腾讯会议选择外接显示器的桌面共享的情况下，放映PPT时才会，外接显示器放的是PPT，主显示器不仅仅有PPT，还有PPT的备注。</p>
<img src="/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/op-screen-1.png" srcset="/myblog/img/loading.gif" lazyload class="" title="image-20240107021250313">
<img src="/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/op-screen-2.png" srcset="/myblog/img/loading.gif" lazyload class="" title="image-20240107021449814">
<p>（左边是我的电脑，右边是外接显示器）</p>
<p>如果临时设置为 mirror
方式连接外接显示器，那么腾讯会议会自动切换共享的屏幕为主屏幕。但是在放映
PPT 时，电脑屏幕和投影仪屏幕是一样的内容。</p>
<h3 id="命令行了解">命令行（了解）</h3>
<p><strong>查看连接的显示器</strong>：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">xrandr<br></code></pre></td></tr></table></figure>
<p>输出：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs bash">Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192<br>eDP-1 connected primary (normal left inverted right x axis y axis)<br>......<br>HDMI-1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 509mm x 286mm<br>...<br>DP-1 disconnected (normal left inverted right x axis y axis)<br></code></pre></td></tr></table></figure>
<p>可以得出我的电脑有三个输出端口，分别为
eDP-1端口，HDMI-1端口，DP-1端口，你的输出结果可能和我不一样，没关系，名字而已。容易知道eDP-1是主输出端口，也就是笔记本电脑的屏幕，DP-1
没有连接，HDMI-1已经连接。</p>
<p><strong>使用复制模式</strong>：HDMI-1是外显示屏，eDF-1是自己电脑，注意要换成你的具体情况</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">xrandr --output HDMI-1 --same-as eDP-1 --auto<br></code></pre></td></tr></table></figure>
<p><strong>扩展模式</strong>：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">xrandr --output HDMI-1 --right-of eDP-1 --auto<br></code></pre></td></tr></table></figure>
<p><strong>单显示屏</strong>：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-comment"># 仅使用外显示屏</span><br>xrandr  --output  eDP-1 --off<br><br><span class="hljs-comment"># 仅使用主屏幕</span><br>xrandr  --output  HDMI-1 --off<br><br><span class="hljs-comment"># 开启主屏幕，开启外显示屏同理</span><br>xrandr --output eDP-1 --auto<br></code></pre></td></tr></table></figure>
<p><strong>特别注意：</strong>当主屏幕是关闭的状态下，不能开启复制或者扩展模式，所以当执行了</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">xrandr --output eDP-1 --off <br></code></pre></td></tr></table></figure>
<p>之后（当前为仅第二屏幕）不能直接转换到复制或者扩展模式，需要先执行</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">xrandr --output eDP-1 --auto<br></code></pre></td></tr></table></figure>
<p>打开主显示器才可以。切记！</p>
<h2 id="新增输出到pdf">新增‘输出到pdf’</h2>
<p>在使用 <code>wps for linux</code>
时想要使用打印机输出到pdf，发现并没有这个选项。</p>
<p>由于ubuntu使用的打印系统也是 cups(common uinx print
system)，所以这种打印到pdf文件的方法基本上对所有unix
like系统是通用的。</p>
<p>首先需要安装cups-pdf包：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt install cups-pdf<br></code></pre></td></tr></table></figure>
<p>这个时候 settings 里就已经出现了对应的打印机</p>
<img src="/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/op-output-to-pdf.png" srcset="/myblog/img/loading.gif" lazyload class="" title="image-20240107014121287">
<p>可以使用wps进行愉快地操作了。</p>
<p><strong>修改 cups 输出PDF的位置</strong>：默认在 <code>~/PDF</code>
里。可以在 <code>/etc/cups/cups-pdf.conf</code> 里修改，修改如下：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">Out <span class="hljs-variable">$&#123;HOME&#125;</span>/Documents/CUPS_PDF<br></code></pre></td></tr></table></figure>
<h2 id="自动挂载其他分区">自动挂载其他分区</h2>
<p>参考：https://blog.csdn.net/lyn631579741/article/details/121240095</p>
<p>系统开机的时候会读取<code>/etc/fstab</code>这个文件中的内容，根据文件配置情况去挂载磁盘。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">vi /etc/fstab<br><span class="hljs-comment"># 命令配置的参数如下</span><br><span class="hljs-comment"># &lt;file system&gt;`，`&lt;mount point&gt;`，`&lt;type&gt;`，`&lt;options&gt;`，`&lt;dump&gt;`，`&lt;pass&gt;`</span><br></code></pre></td></tr></table></figure>
<p>设备名，例如/dev/sda1。</p>
<p>挂载点，是一个系统上存在的文件夹。</p>
<p>设备的类型，例如ext4。用man
fstab可以查到支持的类型，window盘的文件类型是ntfs。</p>
<p>挂载时采用的参数，一般是defaults。</p>
<p>dump-freq和pass-num，一般设置为0，表示启动时不检查要挂载的设备</p>
<h4 id="查看当前连接的磁盘信息">查看当前连接的磁盘信息</h4>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo fdisk -l<br></code></pre></td></tr></table></figure>
<p>输出如下：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs bash">Device              Start        End   Sectors   Size Type<br>....<br>/dev/nvme0n1p3     239616  209954815 209715200   100G Microsoft basic data<br>/dev/nvme0n1p4  636347760  971900927 335553168   160G Microsoft basic data<br>.....<br></code></pre></td></tr></table></figure>
<h4 id="查看磁盘对应的uuid">查看磁盘对应的UUID</h4>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">ls</span> -l /dev/disk/by-uuid<br></code></pre></td></tr></table></figure>
<p>由前面fdisk输出的信息，我们可以知道 Windows C盘的设备名称是
<code>/dev/nvm0n1p3</code>，Windows
E盘的设备名称是<code>/dev/nvm0n1p4</code>。</p>
<p>因此我们可以捕捉到<code>ls -l /dev/disk/by-uuid</code>的输出如下：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">lrwxrwxrwx 1 root root 15 Oct 23 10:37 AC76FE6D76FE37A2 -&gt; ../../nvme0n1p3<br>lrwxrwxrwx 1 root root 15 Oct 23 10:29 CE46863846862177 -&gt; ../../nvme0n1p4<br></code></pre></td></tr></table></figure>
<p>因此使用<code>sudo blkid /dev/nvm0n1px</code>输出如下：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">/dev/nvme0n1p3: LABEL=<span class="hljs-string">&quot;Windows&quot;</span> BLOCK_SIZE=<span class="hljs-string">&quot;512&quot;</span> UUID=<span class="hljs-string">&quot;AC76FE6D76FE37A2&quot;</span> TYPE=<span class="hljs-string">&quot;ntfs&quot;</span> PARTLABEL=<span class="hljs-string">&quot;Basic data partition&quot;</span> PARTUUID=<span class="hljs-string">&quot;64bf9ef9-3dbc-4997-b328-b1ff055e3a59&quot;</span><br>/dev/nvme0n1p4: LABEL=<span class="hljs-string">&quot;E&quot;</span> BLOCK_SIZE=<span class="hljs-string">&quot;512&quot;</span> UUID=<span class="hljs-string">&quot;CE46863846862177&quot;</span> TYPE=<span class="hljs-string">&quot;ntfs&quot;</span> PARTLABEL=<span class="hljs-string">&quot;Basic data partition&quot;</span> PARTUUID=<span class="hljs-string">&quot;66803707-d0d3-4cb5-b3eb-40924f6221d3&quot;</span><br></code></pre></td></tr></table></figure>
<h4 id="修改etcfstab">修改/etc/fstab</h4>
<p>追加如下：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-comment"># Windows C</span><br>UUID=AC76FE6D76FE37A2 /media/joelee/C           ntfs    defaults        0       0<br><span class="hljs-comment"># Windows E</span><br>UUID=CE46863846862177 /media/joelee/E           ntfs    defaults        0       0<br>UUID=dca95af1-1e79-492d-aa35-cef3ce09f525 /home/joelee/VM           ext4      defaults     0      0 <br></code></pre></td></tr></table></figure>
<p>重启查看挂载信息：<code>df -Th</code></p>
<h2 id="右键新建-.txt-和-.md">右键新建 .txt 和 .md</h2>
<p>ubuntu22.04在文件夹中右键无法新建.txt和.md文件，可以打开terminal，进入/home目录下的Template，使用touch命令分别创建Text.txt和MarkDown.md，再往里面写“一些东西”（反正不能是空的，哪怕是空格）。效果如下：</p>
<img src="/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/op-rightclick-newfile.png" srcset="/myblog/img/loading.gif" lazyload class="" title="image-20240107014555742">
<h2 id="按照大小顺序列出所有软件">按照大小顺序列出所有软件</h2>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">dpkg-query -W --showformat=<span class="hljs-string">&#x27;$&#123;Installed-Size;10&#125; $&#123;Package&#125; $&#123;Status&#125;\n&#x27;</span>| grep -v deinstall | <span class="hljs-built_in">sort</span> -rn | awk <span class="hljs-string">&#x27;&#123;printf &quot;%.3f MB \t %s \n&quot;, $1/(1024), $2&#125;&#x27;</span><br></code></pre></td></tr></table></figure>
<h2 id="ffmpeg">ffmpeg</h2>
<h3 id="转-.ts-为-.mp4">转 .ts 为 .mp4</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">ffmpeg -i test.ts -acodec copy -vcodec copy -f mp4 test.mp4<br></code></pre></td></tr></table></figure>
<h3 id="合并视频和音频">合并视频和音频</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">ffmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a aac -strict experimental output.mp4<br></code></pre></td></tr></table></figure>
<ul>
<li>-i video.mp4：指定视频文件路径。</li>
<li>-i audio.mp3：指定音频文件路径。</li>
<li>-c:v copy：将视频流复制到输出文件中，不进行重新编码。</li>
<li>-c:a aac：使用AAC编码音频流。</li>
<li>-strict experimental：启用实验性AAC编码器。</li>
<li>output.mp4：指定输出文件路径和名称。</li>
</ul>
<h3 id="转.mp4为.mp3">转.mp4为.mp3</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">ffmpeg -i input.mp4 -vn -acodec libmp3lame -q:a 4 output.mp3<br></code></pre></td></tr></table></figure>
<ul>
<li><code>-i input.mp4</code>：指定输入文件名为<code>input.mp4</code>。</li>
<li><code>-vn</code>：禁用视频流，只保留音频流。</li>
<li><code>-acodec libmp3lame</code>：选择音频编解码器为LAME MP3。</li>
<li><code>-q:a 4</code>：指定音频质量，取值范围为0（最好）到9（最差），4为默认值，表示较高的质量。</li>
</ul>
<h2 id="find命令">find命令</h2>
<p>在Ubuntu中，<code>find</code>命令用于在文件系统中查找文件和目录。它的具体用法如下：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">find [路径] [表达式]<br></code></pre></td></tr></table></figure>
<ul>
<li><code>路径</code>:
可选参数，指定要搜索的起始路径。如果未指定路径，则默认从当前目录开始搜索。</li>
<li><code>表达式</code>:
是用来描述要查找的文件或目录的匹配条件。<code>find</code>命令将会递归地在指定路径及其子目录下查找符合条件的文件和目录。</li>
</ul>
<p>以下是<code>find</code>命令常用的表达式：</p>
<ol type="1">
<li><p>查找指定文件名的文件：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">arduinoCopy code<br>find [路径] -name <span class="hljs-string">&quot;文件名&quot;</span><br></code></pre></td></tr></table></figure></li>
<li><p>查找符合通配符模式的文件名：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">arduinoCopy code<br>find [路径] -name <span class="hljs-string">&quot;*.扩展名&quot;</span><br></code></pre></td></tr></table></figure></li>
<li><p>忽略文件名大小写进行查找：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">arduinoCopy code<br>find [路径] -iname <span class="hljs-string">&quot;文件名&quot;</span><br></code></pre></td></tr></table></figure></li>
<li><p>查找指定类型的文件（例如，查找所有的文本文件）：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">luaCopy code<br>find [路径] -<span class="hljs-built_in">type</span> f<br></code></pre></td></tr></table></figure></li>
<li><p>查找指定类型的目录：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">luaCopy code<br>find [路径] -<span class="hljs-built_in">type</span> d<br></code></pre></td></tr></table></figure></li>
<li><p>根据文件大小查找：</p>
<ul>
<li>查找大于指定大小的文件：<code>find [路径] -size +[大小]c</code></li>
<li>查找小于指定大小的文件：<code>find [路径] -size -[大小]c</code>
其中，<code>[大小]</code>可以是以字节（b）、千字节（k）或兆字节（M）为单位的数值。</li>
</ul></li>
<li><p>根据文件修改时间查找：</p>
<ul>
<li>查找在N天之前被修改过的文件：<code>find [路径] -mtime +N</code></li>
<li>查找在N天内被修改过的文件：<code>find [路径] -mtime -N</code></li>
</ul></li>
<li><p>根据权限查找：</p>
<ul>
<li>查找具有指定权限的文件：<code>find [路径] -perm 权限</code></li>
</ul></li>
<li><p>组合多个条件：</p>
<ul>
<li>使用AND逻辑：<code>find [路径] -条件1 -a -条件2</code></li>
<li>使用OR逻辑：<code>find [路径] -条件1 -o -条件2</code></li>
</ul></li>
</ol>
<h2 id="命令行来解压">命令行来解压</h2>
<h3 id="解压-.tar.zx">解压 .tar.zx</h3>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">tar -xJf 文件名.tar.xz<br></code></pre></td></tr></table></figure>
<ul>
<li><code>-x</code>: 表示解压操作。</li>
<li><code>-J</code>: 表示使用<code>xz</code>解压器进行解压。</li>
<li><code>-f</code>: 后面跟着要解压的文件名。</li>
</ul>
<h3 id="解压由多个文件组成的压缩包">解压由多个文件组成的压缩包</h3>
<p>解压以<code>.7z.001</code>至<code>.7z.005</code>结尾的压缩文件</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">7z x -mmt8 file.7z.001<br><span class="hljs-comment"># 自动检测并解压所有的.7z.00X文件，将它们组合成完整的压缩文件。</span><br><span class="hljs-comment"># -mmt8 使用8个线程</span><br></code></pre></td></tr></table></figure>
<p>若想输出到指定目录：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">7z x -o/home/user/documents file.7z.001<br></code></pre></td></tr></table></figure>
<h2 id="查看-gtk-的版本">查看 gtk 的版本</h2>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">gtk-launch --version<br></code></pre></td></tr></table></figure>
<h2 id="bilibili批量取消关注">bilibili批量取消关注</h2>
<p>在关注列表每一页执行如下代码（F12 - Console控制台）：</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs javascript">($(<span class="hljs-string">&quot;.be-dropdown-item:contains(&#x27;取消关注&#x27;)&quot;</span>).<span class="hljs-title function_">slice</span>(<span class="hljs-number">0</span>,<span class="hljs-number">10</span>)).<span class="hljs-title function_">click</span>()<br></code></pre></td></tr></table></figure>
<p>如果出现弹窗或者没有关注的up主但数量还在的情况，请重新刷新再输入以上代码。</p>
<p>如果不允许复制代码到控制台，则输入<code>allow pasting</code>解除限制。</p>
<h2 id="更改gtk应用的标题栏的高度">更改gtk应用的标题栏的高度</h2>
<p>编辑<code>~/.config/gtk-3.0/gtk.css</code>，添加</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><code class="hljs css">headerbar<span class="hljs-selector-class">.default-decoration</span> &#123;<br> <span class="hljs-attribute">padding-top</span>: <span class="hljs-number">3px</span>;<br> <span class="hljs-attribute">padding-bottom</span>: <span class="hljs-number">3px</span>;<br> <span class="hljs-attribute">min-height</span>: <span class="hljs-number">24px</span>;    <span class="hljs-comment">/* 标题栏高度 */</span><br> <span class="hljs-attribute">font-size</span>: <span class="hljs-number">1.0em</span>;<br>&#125;<br><br>headerbar<span class="hljs-selector-class">.default-decoration</span> <span class="hljs-selector-tag">button</span><span class="hljs-selector-class">.titlebutton</span> &#123;<br> <span class="hljs-attribute">padding-top</span>: <span class="hljs-number">3px</span>;<br> <span class="hljs-attribute">padding-bottom</span>: <span class="hljs-number">3px</span>;<br> <span class="hljs-attribute">min-height</span>: <span class="hljs-number">0px</span>;<br>&#125;<br></code></pre></td></tr></table></figure>
<p>然后按<code>alt+F2</code>，输入<code>r</code>重载桌面。</p>
<h2 id="清理">清理</h2>
<h3 id="方法">方法</h3>
<p>（1）如果是虚拟机的话，可以删除.cache/vmware/drag_and_drop/路径下缓存区数据，因为通过vmware安装的虚拟机时会安装vmware
tools,其中为了方便拷贝数据，会在ubuntu系统.cache/vmware/drag_and_drop/路径下创建一些缓存目录，从windows中拷贝过来会先存储在这里，粘贴完了我们自然可以把他删除。</p>
<p>（2）在/var/log/journal/垃圾日志文件，可以看到他的内存占用是比较大的，那么我们可以通过如下命令来清除这些日志文件</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs bash">journalctl --disk-usage        <span class="hljs-comment"># 检查日志大小</span><br>sudo journalctl --vacuum-time=1w    <span class="hljs-comment"># 只保留一周的日志</span><br><br>sudo journalctl --vacuum-size=500M    <span class="hljs-comment"># 只保留500MB的日志</span><br><br><span class="hljs-built_in">rm</span> -rf /var/log/journal/askd342fh35aewfhagf67iuro1（垃圾文件）    <span class="hljs-comment"># 直接删除/var/log/journal/目录下的日志文件</span><br><br><span class="hljs-built_in">du</span> -sh ~/.cache/thumbnails       <span class="hljs-comment"># 检查缩略图缓存的大小</span><br><span class="hljs-built_in">rm</span> -rf ~/.cache/thumbnails/*     <span class="hljs-comment"># 清除缩略图缓存</span><br></code></pre></td></tr></table></figure>
<p>（3）清理升级缓存以及无用包</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt-get autoclean                <span class="hljs-comment"># 删除旧版本软件缓存</span><br>sudo apt-get clean                    <span class="hljs-comment"># 删除系统内所有软件缓存</span><br>sudo apt-get autoremove             <span class="hljs-comment"># 删除系统不再使用的孤立软件</span><br></code></pre></td></tr></table></figure>
<p>（4）如果电脑装有<a
target="_blank" rel="noopener" href="https://so.csdn.net/so/search?q=VScode&amp;spm=1001.2101.3001.7020">VScode</a>可以删除VScode中ipch文件（可以在磁盘分析器baobab中查看下面路径内容）</p>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs awk"><span class="hljs-regexp">/home/</span>joelee<span class="hljs-regexp">/.cache/</span>vscode-cpptools/ipch  <span class="hljs-comment"># 63MB</span><br></code></pre></td></tr></table></figure>
<p><strong>Cache</strong>：在计算机存储系统的层次结构中，介于中央处理器和主存之间的高速小容量存储器。它和主存储器一起构成一级的存储器。高速缓存存储器和主存存储器之间信息的调度和传送是由硬件自动进行的。
<strong>Ipch</strong>：这些文件是Visual
Studio用来保存预编译版的头文件和Intellisense用的。如果删除后，重新加载项目会重建这些文件，但VSCode中设定范围后就不会产生超过这个数的缓存大小。
ipch文件内包含缓存的预编译头文件（PCH），vscode使用的时间越长，那么这个文件夹内的缓存就越多，最终会造成较大的内存占用。当我们不用来运行很大的文件时，只是利用它来敲代码，用不到预编译头文件时可以关闭这个功能。
<strong>操作</strong> 在VSCode菜单栏中
文件-&gt;首选项-&gt;设置（ctrl+，），然后搜索C_Cpp.intelliSenseCacheSize,修改其默认值5120为512</p>
<p>（5）如果装有anaconda软件，当使用一段时间之后会占用相当一部分磁盘空间到pkgs文件夹下，在<a
target="_blank" rel="noopener" href="https://so.csdn.net/so/search?q=conda&amp;spm=1001.2101.3001.7020">conda</a>的设计中，目录’pkgs’是下载、存放缓存，当通过pip下载一些软件时，先去缓存区查找有无目标，若无目标会下载包至缓存区当中，再解压安装到指定环境当中的lib/pythonx.x/site-packages中。
同时，anaconda一起携带的包也会放在pkgs中。我们在构建一些envs的时候，对一些包的依赖会通过硬盘链接链接到pkgs目录，这样虚拟环境生成的速度大大加快，占用空间就大大减小了。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs bash">conda clean -p  <span class="hljs-comment"># 这个命令会检查哪些包没有在包缓存中被硬依赖到其他地方，并删除它们</span><br>conda clean --packages  <span class="hljs-comment"># 删除从不使用的包</span><br>conda clean --tarballs  <span class="hljs-comment"># 删除tar包</span><br>conda clean -a  <span class="hljs-comment"># 更强力些，删除索引缓存、锁定文件、未使用过的包和tar包</span><br></code></pre></td></tr></table></figure>
<p>删除不用的pip缓存</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">rm</span> -rf ~/.cache/pip/*<br></code></pre></td></tr></table></figure>
<p>（6）在
/var/lib路径下能查到snapd文件占用内存很大，通过百度发现snap是一款开源的压缩，只读文件系统，基于GPL协议发行的软件打包格式。一旦snap被安装后，其就有一个只读的文件系统和一个可写入的区域。应用自身的执行文件、库、依赖包都被放在这个只读目录，意味着该目录不能被随意篡改和写入。
所以说snap不是一个必须要用到的软件，后续用到也可以再次下载。
通过下面命令删除snapd</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt-fast autoremove --purge snapd<br></code></pre></td></tr></table></figure>
<p>（7）清理rc包</p>
<p>有些包卸载不彻底，也会导致各种问题。
debian系的底层包管理程序dpkg可以对于帮助我们找到这些包。</p>
<p>使用<code>dpkg --list</code>可以查看所有包的状态，其中前两位表示状态，第一位为期望的状态，第二位为实际的状态。可以大致理解为：当我们输入安装命令时，第一位置为i（表示install），当命令完成时，第二位置为i。
更细节的表示可以参考文档，或者查看：https://linuxprograms.wordpress.com/2010/05/11/status-dpkg-list/</p>
<p>一个常见的非理想状态是：第一位为r（removed），第二位为c（Cfg-file存在)。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-comment"># 查看rc状态的包</span><br>dpkg --list |grep <span class="hljs-string">&quot;^rc&quot;</span><br><span class="hljs-comment"># 清除</span><br>dpkg --list |grep <span class="hljs-string">&quot;^rc&quot;</span> | <span class="hljs-built_in">cut</span> -d <span class="hljs-string">&quot; &quot;</span> -f 3 | xargs sudo dpkg --purge<br><span class="hljs-comment"># 或者使用aptitude</span><br>sudo aptitude purge <span class="hljs-string">&quot;~c&quot;</span><br></code></pre></td></tr></table></figure>
<h1 id="常见bug">常见bug</h1>
<h2 id="fcitx框架候选词不跟随">fcitx框架候选词不跟随</h2>
<p>在使用Jet Brains系列产品时，使用 fcitx
框架的搜狗输入法时会出现候选词窗口在“消失”的现象。目前并没有很好的解决办法。。。不过可以设置
<code>搜狗输入法-候选词呈竖排</code> 。效果如下：</p>
<img src="/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/bug-fcitx.png" srcset="/myblog/img/loading.gif" lazyload class="" title="image-20240107015353931">
<h2 id="无法在-右键-打开方式-里找到想要软件">无法在 右键-打开方式
里找到想要软件</h2>
<p>在相应软件的 <code>.desktop</code> 文件的 <code>Exec</code>
行末尾添加 <code>%U</code> 或 <code>%F</code> 。</p>
<h2 id="老是-internal-error">老是 internal error</h2>
<img src="/myblog/2024/01/07/ubuntu%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F%E6%97%A5%E5%B8%B8%E8%AE%B0%E5%BD%95/bug-internal-error.png" srcset="/myblog/img/loading.gif" lazyload class="" title="image-20240107015802810">
<p>一般是_usr_bin_fcitx-dbus-watcher或者WPS堆栈溢出，apport自动收集crash信息（/var/crash），呈现给用户并咨询是否发送给ubuntu。</p>
<p>保存的crash文件只要不处理，每次启动都会提示，要么选择解决这个问题，要么选择把crash文件删掉或者点击don't
send, 毕竟绝大多数情况程序崩溃不是经常能够遇到.</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo service apport stop<br>sudo vi /etc/default/apport<br>sudo apt autoremove --purge apport  <span class="hljs-comment"># 1,302 kB</span><br>sudo <span class="hljs-built_in">rm</span> -rf /var/crash/*<br></code></pre></td></tr></table></figure>
<p><code>/var/crash/</code> 里有：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><code class="hljs bash">-rw-r----- 1 joelee   whoopsie 11205410 10月 14 23:49 _usr_bin_nautilus.1000.crash<br>-rw-rw-r-- 1 joelee   whoopsie        0 10月 14 23:49 _usr_bin_nautilus.1000.upload<br>-rw------- 1 whoopsie whoopsie       37 10月 14 23:50 _usr_bin_nautilus.1000.uploaded<br>-rw-rw-r-- 1 joelee   whoopsie        0 10月 15 13:10 _opt_kingsoft_wps-office_office6_wpsoffice.1000.upload<br>-rw------- 1 whoopsie whoopsie       37 10月 15 13:10 _opt_kingsoft_wps-office_office6_wpsoffice.1000.uploaded<br>-rw-r----- 1 joelee   whoopsie  5661066 10月 15 13:44 _usr_share_sangfor_EasyConnect_EasyConnect.1000.crash<br>-rw-r----- 1 joelee   whoopsie  3504113 10月 15 13:46 _usr_bin_file-roller.1000.crash<br>-rw-r----- 1 joelee   whoopsie 16554936 10月 16 13:27 _opt_kingsoft_wps-office_office6_wpsoffice.1000.crash<br>-rw-r----- 1 joelee   whoopsie   103346 10月 16 23:40 _usr_bin_fcitx-dbus-watcher.1000.crash<br>-rw-r----- 1 joelee   whoopsie 17087885 10月 16 23:40 _opt_kingsoft_wps-office_office6_wpscloudsvr.1000.crash<br>-rw-rw-r-- 1 joelee   whoopsie        0 10月 17 09:05 _opt_kingsoft_wps-office_office6_wpscloudsvr.1000.upload<br>-rw------- 1 whoopsie whoopsie       37 10月 17 09:05 _opt_kingsoft_wps-office_office6_wpscloudsvr.1000.uploaded<br></code></pre></td></tr></table></figure>
<h2 id="vim-common方向键">vim-common方向键</h2>
<p>使用内置的 vim 时，按方向键输出一些乱码。只需要卸载内置的
<code>vim-common</code> ，安装完整版的 <code>vim</code> 。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt autoremove --purge vim-common<br>sudo apt install vim  <span class="hljs-comment"># 38.3 MB</span><br></code></pre></td></tr></table></figure>
<h2 id="蓝牙卡住">蓝牙卡住</h2>
<p>使用 <code>systemctl status bluetooth.service</code>
命令查看蓝牙服务的运行日志，发现报错</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">Failed to <span class="hljs-built_in">set</span> mode: Authentication Failed (0x05)<br></code></pre></td></tr></table></figure>
<p>解决方法：可能是需要重新加载蓝牙模块。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo rmmod btusb<br>sudo modprobe btusb<br></code></pre></td></tr></table></figure>
<h3 id="pulseaudio-pipewire">PulseAudio-&gt;PipeWire</h3>
<p>报错信息：<code>src/service.c:btd_service_connect() a2dp-sink profile connect failed for 50:A4:9B:7D:45:4C: Device or resource busy</code></p>
<p>链接：https://mephisto.cc/tech/airpods_pro2/</p>
<p>bluetooth 服务提示： <strong>src/service.c:btd_service_connect()
a2dp-sink profile connect failed for C0:95:6D:C0:A3:92: Protocol not
available</strong></p>
<blockquote>
<p>我的原因是 Device or resource busy，但也可以使用该方法</p>
</blockquote>
<p>这就是 linux 用户的日常，搜索后确定大致原因为，Ubuntu 22.10
桌面版本音频服务从 PulseAudio 切换到 PipeWire, 导致的服务异常。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt-fast install wireplumber libspa-0.2-bluetooth<br>systemctl --user restart wireplumber.service<br></code></pre></td></tr></table></figure>
<blockquote>
<p>依赖包解释说明</p>
<ul>
<li><code>WirePlumber</code> is a modular session / policy manager for
PipeWire</li>
<li><code>libspa-0.2-bluetooth</code> libraries for the PipeWire
multimedia server bluetooth plugins</li>
</ul>
</blockquote>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><code class="hljs bash">➜  bluetoothctl<br>Agent registered<br>[bluetooth]<span class="hljs-comment"># connect C0:95:6D:C0:A3:92</span><br>Attempting to connect to C0:95:6D:C0:A3:92<br>[CHG] Device C0:95:6D:C0:A3:92 Connected: <span class="hljs-built_in">yes</span><br>[NEW] Endpoint /org/bluez/hci0/dev_C0_95_6D_C0_A3_92/sep1<br>[NEW] Endpoint /org/bluez/hci0/dev_C0_95_6D_C0_A3_92/sep2<br>[NEW] Endpoint /org/bluez/hci0/dev_C0_95_6D_C0_A3_92/sep3<br>[NEW] Transport /org/bluez/hci0/dev_C0_95_6D_C0_A3_92/sep1/fd0<br>[CHG] Transport /org/bluez/hci0/dev_C0_95_6D_C0_A3_92/sep1/fd0 Delay: 0x05dc (1500)<br>Connection successful<br></code></pre></td></tr></table></figure>
<h2 id="need-to-be-reinstallcant-find-an-archive">need to be
reinstall,can’t find an archive</h2>
<p>The package xxx needs to be reinstalled, but I can't find an archive
for it</p>
<p>备份<code>/var/lib/dpkg/status</code>，然后在status中找到报错的xxx包，删除该软件包的全部记录。没删完全会报错~</p>
<h2 id="apt-key-is-deprecated.">apt-key is deprecated.</h2>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-comment"># If your existing use of apt-key add looks like this:</span><br>wget -qO- https://myrepo.example/myrepo.asc | sudo apt-key add -<br><span class="hljs-comment"># Then you can directly replace this with (though note the recommendation below):</span><br>wget -qO- https://myrepo.example/myrepo.asc | sudo <span class="hljs-built_in">tee</span> /etc/apt/trusted.gpg.d/myrepo.asc<br><span class="hljs-comment"># Make sure to use the &quot;asc&quot; extension for ASCII armored keys and the &quot;gpg&quot; extension for the binary OpenPGP format (also known as &quot;GPG key public ring&quot;).</span><br></code></pre></td></tr></table></figure>
<h1 id="其他">其他</h1>
<h2 id="nmap">nmap</h2>
<p>更全面地查看局域网中所有主机的 IP</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-comment"># 4items, 25.6MB</span><br><span class="hljs-comment"># liblinear4 lua-lpeg nmap nmap-common</span><br>sudo apt-fast install nmap<br></code></pre></td></tr></table></figure>
<p>用法：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br></pre></td><td class="code"><pre><code class="hljs bash">nmap -sn 192.168.5.0/24<br><span class="hljs-comment"># output</span><br>Starting Nmap 7.80 ( https://nmap.org ) at 2024-03-29 11:06 CST<br>Nmap scan report <span class="hljs-keyword">for</span> zte.home (192.168.5.1)<br>Host is up (0.0070s latency).<br>Nmap scan report <span class="hljs-keyword">for</span> 192.168.5.2<br>Host is up (0.013s latency).<br>Nmap scan report <span class="hljs-keyword">for</span> 192.168.5.10<br>Host is up (0.020s latency).<br>Nmap scan report <span class="hljs-keyword">for</span> 192.168.5.25 (192.168.5.25)<br>Host is up (0.024s latency).<br>Nmap scan report <span class="hljs-keyword">for</span> 192.168.5.28<br>Host is up (0.010s latency).<br>Nmap scan report <span class="hljs-keyword">for</span> 192.168.5.53<br>Host is up (0.019s latency).<br>Nmap scan report <span class="hljs-keyword">for</span> 192.168.5.126 (192.168.5.126)<br>Host is up (0.026s latency).<br>Nmap scan report <span class="hljs-keyword">for</span> 192.168.5.128<br>Host is up (0.39s latency).<br>Nmap scan report <span class="hljs-keyword">for</span> 192.168.5.131<br>Host is up (0.000061s latency).<br>Nmap scan report <span class="hljs-keyword">for</span> 192.168.5.143 (192.168.5.143)<br>Host is up (0.043s latency).<br>Nmap scan report <span class="hljs-keyword">for</span> 192.168.5.144<br>Host is up (0.013s latency).<br>Nmap scan report <span class="hljs-keyword">for</span> 192.168.5.145<br>Host is up (0.035s latency).<br>Nmap scan report <span class="hljs-keyword">for</span> 192.168.5.152 (192.168.5.152)<br>Host is up (0.089s latency).<br>Nmap scan report <span class="hljs-keyword">for</span> 192.168.5.167<br>Host is up (0.0092s latency).<br>Nmap scan report <span class="hljs-keyword">for</span> 192.168.5.245<br>Host is up (0.0076s latency).<br>Nmap scan report <span class="hljs-keyword">for</span> 192.168.5.246 (192.168.5.246)<br>Host is up (0.014s latency).<br>Nmap scan report <span class="hljs-keyword">for</span> 192.168.5.254<br>Host is up (0.093s latency).<br>Nmap <span class="hljs-keyword">done</span>: 256 IP addresses (17 hosts up) scanned <span class="hljs-keyword">in</span> 6.47 seconds<br></code></pre></td></tr></table></figure>
<h2 id="ettercap-graphical">ettercap-graphical</h2>
<p>ARP 欺骗，将目标主机的流量重定向到你的计算机上</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo apt-fast install ettercap-graphical<br><span class="hljs-comment"># 5items, 13.9MB, ettercap-common ettercap-graphical geoip-database libgeoip1 libnet1</span><br></code></pre></td></tr></table></figure>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/myblog/categories/ubuntu%E4%BD%9C%E4%B8%BA%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F/" class="category-chain-item">ubuntu作为主力系统</a>
  
  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/myblog/tags/ubuntu/" class="print-no-link">#ubuntu</a>
      
        <a href="/myblog/tags/%E4%B8%BB%E5%8A%9B%E7%B3%BB%E7%BB%9F/" class="print-no-link">#主力系统</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>ubuntu主力系统日常记录</div>
      <div>https://joelee-hit.github.io/joelee-hit.github.io/2024/01/07/ubuntu主力系统日常记录/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>joelee</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2024年1月7日</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>更新于</div>
          <div>2024年5月14日</div>
        </div>
      
      
        <div class="license-meta-item">
          <div>许可协议</div>
          <div>
            
              
              
                <a class="print-no-link" target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
                  <span class="hint--top hint--rounded" aria-label="BY - 署名">
                    <i class="iconfont icon-by"></i>
                  </span>
                </a>
              
            
          </div>
        </div>
      
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/myblog/2024/05/16/ubuntu-windowmanager/" title="ubuntu_windowmanager">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">ubuntu_windowmanager</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/myblog/2023/12/29/bochs-linux0-12-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/" title="bochs-linux0-12-环境搭建">
                        <span class="hidden-mobile">bochs-linux0-12-环境搭建</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
  
  
    <article id="comments" lazyload>
      
  <div id="valine"></div>
  <script type="text/javascript">
    Fluid.utils.loadComments('#valine', function() {
      Fluid.utils.createScript('https://lib.baomitu.com/valine/1.5.1/Valine.min.js', function() {
        var options = Object.assign(
          {"appId":"UU4TJ0JQzDgf0er5h2RfW8ve-gzGzoHsz","appKey":"px4eIsDZQBJRxIUkt6PCJpNH","path":"window.location.pathname","placeholder":null,"avatar":"robohash","meta":["nick","mail","link"],"requiredFields":[],"pageSize":10,"lang":"zh-CN","highlight":false,"recordIP":false,"serverURLs":"","emojiCDN":null,"emojiMaps":null,"enableQQ":false},
          {
            el: "#valine",
            path: window.location.pathname
          }
        )
        new Valine(options);
        Fluid.utils.waitElementVisible('#valine .vcontent', () => {
          var imgSelector = '#valine .vcontent img:not(.vemoji)';
          Fluid.plugins.imageCaption(imgSelector);
          Fluid.plugins.fancyBox(imgSelector);
        })
      });
    });
  </script>
  <noscript>Please enable JavaScript to view the comments</noscript>


    </article>
  


          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="margin-left: -1rem">
    <div id="toc">
  <p class="toc-header">
    <i class="iconfont icon-list"></i>
    <span>目录</span>
  </p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
    </div>
  
  
    <div class="statistics">
  
  

  
    
      <span id="leancloud-site-pv-container" style="display: none">
        总访问 
        <span id="leancloud-site-pv"></span>
         次
      </span>
    
    
      <span id="leancloud-site-uv-container" style="display: none">
        总访客 
        <span id="leancloud-site-uv"></span>
         人
      </span>
    
    

  
</div>

  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.4/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/myblog/js/events.js" ></script>
<script  src="/myblog/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/myblog/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.20.1/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init(Object.assign({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      scrollSmooth    : true,
      includeTitleTags: true,
      headingsOffset  : -boardTop,
    }, CONFIG.toc));
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }

    Fluid.events.registerRefreshCallback(function() {
      if ('tocbot' in window) {
        tocbot.refresh();
        var toc = jQuery('#toc');
        if (toc.length === 0 || !tocbot) {
          return;
        }
        if (toc.find('.toc-list-item').length > 0) {
          toc.css('visibility', 'visible');
        }
      }
    });
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));

    Fluid.events.registerRefreshCallback(function() {
      if ('anchors' in window) {
        anchors.removeAll();
        var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
        var res = [];
        for (var item of el) {
          res.push('.markdown-body > ' + item.trim());
        }
        if (CONFIG.anchorjs.placement === 'left') {
          anchors.options.class = 'anchorjs-link-left';
        }
        anchors.add(res.join(', '));
      }
    });
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script defer src="/myblog/js/leancloud.js" ></script>

  <script  src="/myblog/js/local-search.js" ></script>

  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/myblog/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
